此时,容易导致dashboard 起不来,报错如下
[root@h102 codis]# bin/codis-config dashboard
2015/12/04 22:38:14 dashboard.go:160: [INFO] dashboard listening on addr: :18087
2015/12/04 22:38:14 dashboard.go:234: [PANIC] create zk node failed
[error]: dashboard already exists: {"addr": "192.168.100.102:18087", "pid": 36106}
[stack]:
3 /root/go_home/src/github.com/wandoulabs/codis/cmd/cconfig/dashboard.go:234
main.runDashboard
2 /root/go_home/src/github.com/wandoulabs/codis/cmd/cconfig/dashboard.go:54
main.cmdDashboard
1 /root/go_home/src/github.com/wandoulabs/codis/cmd/cconfig/main.go:85
main.runCommand
0 /root/go_home/src/github.com/wandoulabs/codis/cmd/cconfig/main.go:152
main.main
... ...
[root@h102 codis]#
但是直接使用ps查看当前进程,又发现系统中并没有残存任何dashboard进程,端口也并没有被占用
[root@h102 codis]# netstat -an | grep 18087
[root@h102 codis]#
这种情况是由于zk中留存上一次dashboard信息导致的
解决办法是,进入zk中手动删除
[zk: localhost:2181(CONNECTED) 8] ls /zk/codis/db_test/dashboard
[]
[zk: localhost:2181(CONNECTED) 9] get /zk/codis/db_test/dashboard
{"addr": "192.168.100.102:18087", "pid": 36106}
cZxid = 0x143a
ctime = Fri Dec 04 21:17:34 CST 2015
mZxid = 0x143a
mtime = Fri Dec 04 21:17:34 CST 2015
pZxid = 0x143a
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 47
numChildren = 0
[zk: localhost:2181(CONNECTED) 10] rmr /zk/codis/db_test/dashboard
[zk: localhost:2181(CONNECTED) 11]
之后就可以正常启动了
[root@h102 codis]# bin/codis-config dashboard
2015/12/04 22:44:50 dashboard.go:160: [INFO] dashboard listening on addr: :18087
2015/12/04 22:44:50 dashboard.go:143: [INFO] dashboard node created: /zk/codis/db_test/dashboard, {"addr": "192.168.100.102:18087", "pid": 36799}
2015/12/04 22:44:50 dashboard.go:144: [WARN] ********** Attention **********
2015/12/04 22:44:50 dashboard.go:145: [WARN] You should use `kill {pid}` rather than `kill -9 {pid}` to stop me,
2015/12/04 22:44:50 dashboard.go:146: [WARN] or the node resisted on zk will not be cleaned when I'm quiting and you must remove it manually
2015/12/04 22:44:50 dashboard.go:147: [WARN] *******************************
...
...
...
原文地址http://soft.dog/2015/12/05/codis/
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。