一. 编译安装
#将redis解压到/opt下 tar zxvf redis-3.0.7.tar.gz -C /opt #进入redis目录,并编译 cd /opt/redis-3.0.7 && make MALLOC=libc #安装redis make install
二. 修改配置
#创建目录 mkdir /usr/local/etc/redis-cluster/redis-7000 /usr/local/etc/redis-cluster/redis-7001 #创建配置文件 cp /opt/redis-3.0.7/redis.conf mkdir /usr/local/etc/redis-cluster/redis-7000/ #修改配置文件 vim /opt/redis-3.0.7/redis.conf /usr/local/etc/redis-cluster/redis-7000/redis.conf 修改如下配置: port 7000 daemonize yes cluster-enabled yes cluster-config-file nodes.confc luster-node-timeout 5000 appendonly yes 端口号需要根据实际更改;
三. 启动Redis
/usr/local/bin/redis-server /opt/redis/cluster/redis-7000.conf
时间: 2024-10-16 02:31:41