安装redis 最新版 redis-6.2.6

编译安装redis

# 下载源码包
~]# wget http://download.redis.io/releases/redis-6.2.6.tar.gz
~]# tar -zxvf redis-6.2.6.tar.gz

# 编译安装
~]# cd redis-6.2.6 
redis-6.2.6]# make && make install PREFIX=/usr/local/redis

# 修改配置
redis-6.2.6]# mkdir /usr/local/redis/{conf,data} -p

redis-6.2.6]# cp /usr/local/src/redis-6.2.6/redis-6.2.6/redis.conf /usr/local/redis/conf/

redis-6.2.6]# vim /usr/local/redis/conf/redis.conf
bind 0.0.0.0
protected-mode no
daemonize yes
databases 256
dir /usr/local/redis/data
requirepass redis123 # 启动文件 redis
-6.2.6]# vi /etc/systemd/system/redis.service  [Unit] Description=redis-server After=network.target [Service] Type=forking ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf PrivateTmp=true [Install] WantedBy=multi-user.target # 设置开机自启动 ~]# systemctl daemon-reload ~]# systemctl start redis.service ~]# systemctl enable redis.service # 创建软连接 ~]# ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis

 

posted @ 2022-11-01 13:42  LiShiChao  阅读(418)  评论(0编辑  收藏  举报