# Error jemalloc/jemalloc.h: No such file or directory when making Redis[redis-6.2.0]$makedistclean
# 安装wgethttps://download.redis.io/releases/redis-7.2.4.tar.gz
tar-zxvfredis-7.2.4.tar.gz
cdredis-7.2.4
make
makeinstallPREFIX=/opt/www/redis/redis-7.2.4
# 端口和密码redis-cli-p7000-aPASSWORD
# 创建集群redis-cli--clustercreate127.0.0.1:7000127.0.0.1:7001\127.0.0.1:7002127.0.0.1:7003127.0.0.1:7004127.0.0.1:7005\--cluster-replicas1# 查看集群状态redis-cli-aPASSWORD127.0.0.1:7000
>clusternodes
>clusterinfo
# 作为 master 节点加入集群redis-cli--clusteradd-node127.0.0.1:7006127.0.0.1:7000
# 作为 slave 节点加入集群redis-cli--clusteradd-node127.0.0.1:7006127.0.0.1:7000--cluster-slave
# 从集群中删除节点redis-cli--clusterdel-node127.0.0.1:7000`<node-id>`# however in order to remove a master node it must be empty.# 假设 127.0.0.1:7003 是待移除的 master 节点,要先转移 slot 到其他节点redis-cli--clusterreshard127.0.0.1:7003
# 节点主动退出集群redis-cli127.0.0.1:7003
>flushall
>clusterreset
>exit# 或者清理配置和数据文件rm-rfdata/*
rm-rfconf/nodes.conf
rm-rfdump.rdb
# 报错 [ERR] Not all 16384 slots are covered by nodes.redis-cli--cluster--fix127.0.0.1:7000