在掘金看到了项目相关介绍,很感谢腾讯的同行开源相关项目。👍 试用后感觉很不错,希望有机会可能共同参与到项目生态建设中来。
下面是试用过程中发现的一些问题
- polaris standalone启动约20分钟后无故挂掉
启动后新建了一个service,没有注册服务,之后server就挂掉了
相关日志:
stdout
[INFO] load config from polaris-server.yaml
{Bootstrap:{Logger:{OutputPaths:[] ErrorOutputPaths:[] RotateOutputPath:log/polaris-server.log RotationMaxSize:500 RotationMaxAge:30 RotationMaxBackups:100 JSONEncoding:false LogGrpc:false Level:debug outputLevels: logCallers: stackTraceLevels:} StartInOrder:map[key:sz open:true] PolarisService:{EnableRegister:false ProbeAddress: Isolated:false Services:[0xc000107340 0xc000107380]}} APIServers:[{Name:httpserver Option:map[connLimit:map[maxConnLimit:5120 maxConnPerHost:128 openConnLimit:false purgeCounterExpired:5s purgeCounterInterval:10s whiteList:127.0.0.1] enablePprof:true listenIP:0.0.0.0 listenPort:8090] API:map[admin:{Enable:true Include:[]} client:{Enable:true Include:[discover register healthcheck]} console:{Enable:true Include:[default]}]} {Name:grpcserver Option:map[connLimit:map[maxConnLimit:5120 maxConnPerHost:128 openConnLimit:false] listenIP:0.0.0.0 listenPort:8091] API:map[client:{Enable:true Include:[discover register healthcheck]}]}] Cache:{Open:true Resources:[{Name:service Option:map[disableBusiness:false needMeta:true]} {Name:instance Option:map[disableBusiness:false needMeta:true]} {Name:routingConfig Option:map[]} {Name:rateLimitConfig Option:map[]} {Name:circuitBreakerConfig Option:map[]}]} Naming:{Auth:map[open:false] HealthCheck:{Open:true KvConnNum:0 KvServiceName: KvNamespace: KvPasswd: SlotNum:30 LocalHost: MaxIdle:20 IdleTimeout:120} Batch:map[deregister:map[concurrency:64 maxBatchCount:32 open:true queueSize:10240 waitTime:32ms] register:map[concurrency:64 maxBatchCount:32 open:true queueSize:10240 waitTime:32ms]]} Store:{Name:boltdbStore Option:map[path:./polaris.bolt]} Plugin:{CMDB:{Name: Option:map[]} RateLimit:{Name:token-bucket Option:map[api-limit:map[apis:[map[name:POST:/v1/naming/services rule:store-write] map[name:PUT:/v1/naming/services rule:store-write] map[name:POST:/v1/naming/services/delete rule:store-write] map[name:GET:/v1/naming/services rule:store-read] map[name:GET:/v1/naming/services/count rule:store-read] map[name:]] open:false rules:[map[limit:map[bucket:2000 open:true rate:1000] name:store-read] map[limit:map[bucket:1000 open:true rate:500] name:store-write]]] instance-limit:map[global:map[bucket:2 rate:2] open:true resource-cache-amount:1024] ip-limit:map[global:map[bucket:300 open:true rate:200] open:true resource-cache-amount:1024 white-list:[127.0.0.1]] remote-conf:false]} History:{Name:HistoryLogger Option:map[]} Statis:{Name:local Option:map[interval:60 outputPath:./statis]} DiscoverStatis:{Name:discoverLocal Option:map[interval:60 outputPath:./discover-statis]} ParsePassword:{Name: Option:map[]} Auth:{Name: Option:map[]} MeshResourceValidate:{Name: Option:map[]}}}
finish starting server
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x16a5fdb]
goroutine 96 [running]:
github.com/polarismesh/polaris-server/store/boltdbStore.(*serviceStore).GetSourceServiceToken(0xc0001dcbe0, 0xc00030c890, 0x5, 0xc00030c898, 0x4, 0x0, 0x0, 0x0)
/home/runner/work/polaris/polaris/store/boltdbStore/service.go:181 +0xbb
github.com/polarismesh/polaris-server/naming/batch.(*InstanceCtrl).batchVerifyInstances(0xc0002d4000, 0xc0000d2bd0, 0xc0000d2bd0, 0x0, 0x0, 0xc00007ae00)
/home/runner/work/polaris/polaris/naming/batch/instance.go:385 +0x6ce
github.com/polarismesh/polaris-server/naming/batch.(*InstanceCtrl).registerHandler(0xc0002d4000, 0xc00029a400, 0x1, 0x20, 0xc000107550, 0x1cf2001)
/home/runner/work/polaris/polaris/naming/batch/instance.go:226 +0x2b5
github.com/polarismesh/polaris-server/naming/batch.(*InstanceCtrl).storeWorker(0xc0002d4000, 0x1938c58, 0xc000107540, 0xc)
/home/runner/work/polaris/polaris/naming/batch/instance.go:181 +0x24b
created by github.com/polarismesh/polaris-server/naming/batch.(*InstanceCtrl).Start
/home/runner/work/polaris/polaris/naming/batch/instance.go:93 +0x1b5
polaris-server.log
2021-09-25T00:29:30.821075Z debug timewheel/timewheel.go:128 ckv task timewheel task start time:1632500970, use time:470ns, exec num:0
2021-09-25T00:29:31.819654Z debug timewheel/timewheel.go:128 ckv task timewheel task start time:1632500971, use time:397ns, exec num:0
2021-09-25T00:29:31.819618Z info cache/instance.go:129 [Cache][Instance] get more instances {"update": 0, "delete": 0, "last": "1970-01-01T08:00:00.000000Z", "used": "10.961µs"}
2021-09-25T00:29:31.819654Z debug timewheel/timewheel.go:128 db task timewheel task start time:1632500971, use time:580ns, exec num:0
2021-09-25T00:29:31.819743Z info cache/service.go:129 [Cache][Service] get more services {"update": 1, "delete": 0, "last": "2021-09-25T00:10:18.000000Z", "used": "154.389µs"}
2021-09-25T00:29:32.307459Z info grpcserver/server.go:376 receive request {"client-address": "127.0.0.1:65095", "user-agent": "grpc-go/1.22.0", "request-id": "52831770710", "method": "/v1.PolarisGRPC/ReportClient"}
2021-09-25T00:29:32.820542Z debug timewheel/timewheel.go:128 db task timewheel task start time:1632500972, use time:1.978µs, exec num:0
2021-09-25T00:29:32.820986Z debug timewheel/timewheel.go:128 ckv task timewheel task start time:1632500972, use time:1.324µs, exec num:0
2021-09-25T00:29:32.821241Z info cache/service.go:129 [Cache][Service] get more services {"update": 1, "delete": 0, "last": "2021-09-25T00:10:18.000000Z", "used": "416.22µs"}
2021-09-25T00:29:32.821146Z info cache/instance.go:129 [Cache][Instance] get more instances {"update": 0, "delete": 0, "last": "1970-01-01T08:00:00.000000Z", "used": "239.593µs"}
2021-09-25T00:29:32.830494Z info grpcserver/server.go:376 receive request {"client-address": "127.0.0.1:65096", "user-agent": "grpc-go/1.22.0", "request-id": "1379206009", "method": "/v1.PolarisGRPC/RegisterInstance"}
2021-09-25T00:29:32.842209Z info batch/instance.go:203 [Batch] Start batch creating instances count: 1
- 单机版能否提供docker-compose的启动方式?
个人认为通过一个大zip分发包括 prometheus/pushgateway等组件感觉不是一个很优雅的方式。且在应用挂掉如果后通过uninstall.sh停止全部应用,又导致了所有数据全部丢失,通过docker-compose启动应该会更灵活一点
- go sdk中api的写法不是很优雅
像api.NewProviderAPI() 这种写法令人感到有带一些迷惑,无法很直观的看出来是哪个api(尤其是接入polaris的多数为server端应用,大部分程序都会去建个api包,用于提供对外的rpc或http api)。可能像zap.NewProduction()
或 gin.Default()
这样,写成 polaris.NewProviderAPI()
这样会更直观一点。
- 文档里一些小bug
如 https://polarismesh.cn/zh/doc/%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8/%E4%BD%BF%E7%94%A8polaris-go.html#%E9%85%8D%E7%BD%AE%E6%9C%8D%E5%8A%A1%E7%AB%AF%E5%9C%B0%E5%9D%80
中 在应用当前运行目录下,添加polaris.yml文件,配置服务端地址信息
实际为 polaris.yaml文件
- 控制台中无法新建namespace?
question