Codis 基础17

2022-03-25 10:10:07 浏览数 (1)

修改此值

代码语言:javascript复制
[root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6379 CONFIG set maxmemory 100
OK
[root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6389 CONFIG set maxmemory 100
OK
[root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6390 CONFIG set maxmemory 100
OK
[root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6380 CONFIG set maxmemory 100
OK
[root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6379 CONFIG GET maxmemory
1) "maxmemory"
2) "100"
[root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6380 CONFIG GET maxmemory
1) "maxmemory"
2) "100"
[root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6389 CONFIG GET maxmemory
1) "maxmemory"
2) "100"
[root@h102 codis]# extern/redis-2.8.21/src/redis-cli -p 6390 CONFIG GET maxmemory
1) "maxmemory"
2) "100"
[root@h102 codis]#

进行自动均衡

代码语言:javascript复制
[root@h102 codis]# bin/codis-config slot rebalance 
{
  "msg": "OK",
  "ret": 0
}
[root@h102 codis]# 

codis dashboard重启问题

codis dashboard由于各种原因可能要重启

比如重读配置文件(将zk端口从2180改为2181),此时dashboard会报错

代码语言:javascript复制
2015/12/04 22:38:08 Failed to connect to 192.168.100.101:2180: dial tcp 192.168.100.101:2180: i/o timeout
2015/12/04 22:38:09 Failed to connect to 192.168.100.101:2180: dial tcp 192.168.100.101:2180: i/o timeout
2015/12/04 22:38:09 Failed to connect to 192.168.100.101:2180: dial tcp 192.168.100.101:2180: i/o timeout
2015/12/04 22:38:09 Failed to connect to 192.168.100.101:2180: dial tcp 192.168.100.101:2180: i/o timeout
2015/12/04 22:38:09 Failed to connect to 192.168.100.101:2180: dial tcp 192.168.100.101:2180: i/o timeout

另开一个窗口,手动将dashboard进程杀死

代码语言:javascript复制
[root@h102 codis]# kill  36106 
[root@h102 codis]# ps faux | grep conf
root      1799  0.0  0.1 189408  3784 ?        Ss   09:44   0:00 cupsd -C /etc/cups/cupsd.conf
root     36106  2.8  4.8 310552 93192 pts/0    Sl   21:17   2:16  |       _ bin/codis-config dashboard
root     36715  0.5  1.1 320592 22764 pts/1    Sl   22:37   0:00  |       _ bin/codis-proxy -c config.ini -L /tmp/proxy.log --cpu=2 --addr=0.0.0.0:19000 --http-addr=0.0.0.0:11000
root     36728  0.0  0.0 103256   828 pts/2    S    22:37   0:00          _ grep conf
[root@h102 codis]# kill -9 36106
[root@h102 codis]# ps faux | grep conf
root      1799  0.0  0.1 189408  3784 ?        Ss   09:44   0:00 cupsd -C /etc/cups/cupsd.conf
root     36715  0.4  1.1 320592 22772 pts/1    Sl   22:37   0:00  |       _ bin/codis-proxy -c config.ini -L /tmp/proxy.log --cpu=2 --addr=0.0.0.0:19000 --http-addr=0.0.0.0:11000
root     36730  0.0  0.0 103256   828 pts/2    S    22:38   0:00          _ grep conf
[root@h102 codis]# 

0 人点赞