codis非正常关闭重启过程

codis主节点突然挂掉,重启了一把
非正常关闭,需要进zookeeper中删除/codis下创建的内容

[zk: localhost:2181(CONNECTED) 0] ls /
[jodis, cluster, registry, controller, brokers, storm, zookeeper, infra-solr, hbase-unsecure, hadoop-ha, recognition, admin, isr_change_notification, dubbo, codis3, harpc, templeton-hadoop, controller_epoch, hiveserver2, rmstore, consumers, ambari-metrics-cluster, config]
[zk: localhost:2181(CONNECTED) 1] ls /codis3
[codis-ls]
[zk: localhost:2181(CONNECTED) 2] rmr /codis3/codis-ls

主从都起(从节点没挂,可以不起)

nohup ./bin/codis-dashboard --ncpu=4 --config=config/dashboard.toml --log=logs/dashboard.log --log-level=WARN &


 nohup ./bin/codis-proxy --ncpu=4 --config=config/proxy6900.toml --log=logs/proxy6900.log --log-level=WARN &


 nohup ./bin/codis-proxy --ncpu=4 --config=config/proxy6901.toml --log=logs/proxy6901.log --log-level=WARN &


 nohup ./bin/codis-server config/redis6900.conf &


 nohup ./bin/codis-server config/redis6901.conf &

主起fe

nohup /opt/codis/bin/codis-fe --ncpu=4 --log=logs/fe.log --log-level=WARN --zookeeper=192.168.x.a:2181,192.168.x.b:2181,192.168.x.c:2181 --listen=172.16.x.y:8080 &

主创建proxy

./bin/codis-admin --dashboard=172.16.x.y:18080 --create-proxy -x 172.16.x.y:11080

 ./bin/codis-admin --dashboard=172.16.x.y:18080 --create-proxy -x 172.16.x.y:11081

 ./bin/codis-admin --dashboard=172.16.x.y:18080 --create-proxy -x 172.16.3.184:11080

 ./bin/codis-admin --dashboard=172.16.x.y:18080 --create-proxy -x 172.16.3.184:11081

主加group

注意要先加密码

/opt/codis/bin/redis-cli -h 172.16.x.y -p 6900
172.16.x.y:6900> CONFIG SET requirepass "udptest-2017"
172.16.x.y:6900> AUTH udptest-2017
172.16.x.y:6900> exit

/opt/codis/bin/redis-cli -h 172.16.x.y -p 6901
172.16.x.y:6901> CONFIG SET requirepass "udptest-2017"
172.16.x.y:6901> AUTH udptest-2017
172.16.x.y:6901> exit

/opt/codis/bin/redis-cli -h 172.16.3.184 -p 6900
172.16.3.184:6900> CONFIG SET requirepass "udptest-2017"
172.16.x.y:6900> AUTH udptest-2017
172.16.3.184:6900> exit

/opt/codis/bin/redis-cli -h 172.16.3.184 -p 6901
172.16.3.184:6901> CONFIG SET requirepass "udptest-2017"
172.16.3.184:6901> AUTH udptest-2017
172.16.3.184:6901> exit

创建group

 /opt/codis/bin/codis-admin --dashboard=172.16.x.y:18080 --create-group --gid=1
 /opt/codis/bin/codis-admin --dashboard=172.16.x.y:18080 --create-group --gid=2

加入group

./bin/codis-admin --dashboard=172.16.x.y:18080 --group-add --gid=1 --addr=172.16.x.y:6901

 ./bin/codis-admin --dashboard=172.16.x.y:18080 --group-add --gid=1 --addr=172.16.3.184:6900

 ./bin/codis-admin --dashboard=172.16.x.y:18080 --group-add --gid=2 --addr=172.16.x.y:6900

 ./bin/codis-admin --dashboard=172.16.x.y:18080 --group-add --gid=2 --addr=172.16.3.184:6901

然后进行codis分配

http://note.youdao.com/noteshare?id=5aed9645ec5b807d141722cfb1f2c0a0&sub=BD12D1DD28F44A7E8E119D067CDCE8BD

关闭

 ./codis-admin --dashboard=192.168.x.y:18080 --shutdown

 ./bin/codis-admin --proxy=172.16.x.y:11080  --auth=udptest-2017 --shutdown

你可能感兴趣的:(大数据,linux)