背景:春季前由于要停电,所以直接使用关闭命名shutdown,没有手动关闭codis,导致启动codis dashboard失败。

查看错误日志:

cat /usr/local/codis/logs/dashboard.log.2019-02-11

日志信息:

2019/02/11 13:31:43 topom.go:189: [ERROR] store: acquire lock of codis-testX failed
[error]: zk: node already exists
    6   /opt/gowork/src/github.com/CodisLabs/codis/pkg/models/zk/zkclient.go:247
            github.com/CodisLabs/codis/pkg/models/zk.(*Client).create
    5   /opt/gowork/src/github.com/CodisLabs/codis/pkg/models/zk/zkclient.go:196
            github.com/CodisLabs/codis/pkg/models/zk.(*Client).Create.func1
    4   /opt/gowork/src/github.com/CodisLabs/codis/pkg/models/zk/zkclient.go:129
            github.com/CodisLabs/codis/pkg/models/zk.(*Client).shell
    3   /opt/gowork/src/github.com/CodisLabs/codis/pkg/models/zk/zkclient.go:195
            github.com/CodisLabs/codis/pkg/models/zk.(*Client).Create
    2   /opt/gowork/src/github.com/CodisLabs/codis/pkg/models/store.go:119
            github.com/CodisLabs/codis/pkg/models.(*Store).Acquire
    1   /opt/gowork/src/github.com/CodisLabs/codis/pkg/topom/topom.go:188
            github.com/CodisLabs/codis/pkg/topom.(*Topom).Start
    0   /opt/gowork/src/github.com/CodisLabs/codis/cmd/dashboard/main.go:169
            main.main
        ... ...
[stack]: 
    1   /opt/gowork/src/github.com/CodisLabs/codis/pkg/topom/topom.go:189
            github.com/CodisLabs/codis/pkg/topom.(*Topom).Start
    0   /opt/gowork/src/github.com/CodisLabs/codis/cmd/dashboard/main.go:169
            main.main
        ... ...

需要删除zookeeper的节点

具体代码示例:

1、确认codis-dashboard进程已经退出(很重要)

codis-admin --dashboard=192.168.3.190:18080 --shutdown

2、然后运行codis-admin删除LOCK:

codis-admin --remove-lock --product=codis_demo --zookeeper=127.0.0.1:2181

#### 结果
2019/07/25 10:51:11 zkclient.go:23: [INFO] zookeeper - zkclient setup new connection to 127.0.0.1:2181
2019/07/25 10:51:11 zkclient.go:23: [INFO] zookeeper - Connected to 127.0.0.1:2181
2019/07/25 10:51:11 zkclient.go:23: [INFO] zookeeper - Authenticated: id=72370115218046981, timeout=40000
2019/07/25 10:51:11 zkclient.go:23: [INFO] zookeeper - Re-submitting `0` credentials after reconnect
2019/07/25 10:51:11 zkclient.go:23: [INFO] zookeeper - Recv loop terminated: err=EOF
2019/07/25 10:51:11 zkclient.go:23: [INFO] zookeeper - Send loop terminated: err=<nil>

codis_demo是codis的项目名字

127.0.0.1:2181对应的zookeeper的ip地址

最后:

重启codis-dashboard


本文地址: http://www.chenxm.cc/article/780.html
版权声明: 本文为原创文章,版权归  陈新明  所有,欢迎分享本文,转载请保留出处!
上一篇: django错误:TypeError: __init__() missing 1 required positional argument: 'strategy'
下一篇: codis错误:ResponseError: handle request, slot is not ready, may be offline
发表评论

还没有留言,还不快点抢沙发?