1. 下载:
https://redis.io/
  1. 解压:
tar -xzf redis-5.0.3.tar.gz
  1. 进入目录:
cd redis-5.0.3
  1. 编译安装:
make
  1. 创建配置文件夹:
mkdir  -p  /usr/local/redis/redis_1
mkdir  -p  /usr/local/redis/redis_2
mkdir  -p  /usr/local/redis/redis_3
mkdir  -p  /usr/local/redis/redis_4
mkdir  -p  /usr/local/redis/redis_5
mkdir  -p  /usr/local/redis/redis_6
  1. 创建配置文件: vim /usr/local/redis/redis_1/redis.conf
port  7001
bind  172.20.10.12
requirepass  123456
daemonize  yes
pidfile  /var/run/redis_1.pid
cluster-enabled  yes
cluster-config-file  nodes_1.conf
cluster-node-timeout  10100
appendonly  no
  1. 启动:
src/redis-server /usr/local/redis/redis_1/redis.conf
src/redis-server /usr/local/redis/redis_2/redis.conf
src/redis-server /usr/local/redis/redis_3/redis.conf
src/redis-server /usr/local/redis/redis_4/redis.conf
src/redis-server /usr/local/redis/redis_5/redis.conf
src/redis-server /usr/local/redis/redis_6/redis.conf
  1. 初始化:
src/redis-cli  --cluster  create  172.20.10.12:7001  172.20.10.12:7002  172.20.10.12:7003  172.20.10.12:7004  172.20.10.12:7005  172.20.10.12:7006  -a  123456  --cluster-replicas  1
  1. 检测状态:
src/redis-cli  --cluster  check  172.20.10.12:7001  -a  123456
  1. 连接:
src/redis-cli  -c  -h  172.20.10.12  -p  7001  -a  123456
  1. 停止:
pkill  redis

广告

给大家推荐几个好用的工具

  1. 时间校验工具
  2. ip查询工具
  3. 二维码生成工具
  4. json格式化工具
  5. 时间缀-时间转换工具