Redis安装手册
1、下载安装包:https://redis.io/
wget https://download.redis.io/releases/redis-6.2.6.tar.gz
2、解压缩
cd /user/local/myredis tar -zxvf redis-6.2.6.tar.gz
3、基本的命令环境安装
yum install gcc-c++
4、编译安装
cd redis-6.2.6 make
make install
5、拷贝配置文件
cd /usr/local/bin
mkdir dtconfig
# 从redis的安装目录拷贝到dtconfig
cp /opt/jylcdp/redis/redis-6.2.6/redis.conf dtconfig/
6、配置修改
vim redis.conf
# 默认为no将其改为yes,设置默认后台启动:
daemonize yes
# 修改Redis服务保护模式
# 将yes修改为 no
protected-mode no
# 注释掉 bind 127.0.0.1
#bind 127.0.0.1
7、开机启动
增加redis.service配置,设置开机启动:
vim /etc/systemd/system/redis.service
#配置内容如下:
[Unit]
Description=redis-server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/bin/redis-server /usr/local/bin/dtconfig/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
#启动服务
systemctl daemon-reload systemctl start redis.service systemctl status redis.service systemctl enable redis.service
# 查看服务端口6379是否存储
netstat -tlunp
8、Redis客户端连接
redis-cli -p 6379 shutdown exit