哥伦布

博客园 首页 新随笔 联系 订阅 管理
  73 随笔 :: 0 文章 :: 0 评论 :: 33211 阅读

1、安装必要前缀组件

我是使用root安装
yum install -y epel-release
yum install -y gcc make python3

2、下载Redis7.4.1

wget https://download.redis.io/releases/redis-7.4.1.tar.gz
上面这个我自己get不下来。
我在其他途径下好,放到放到城通网盘
redis-7.4.1.tar.gz (访问密码: 1133)下载链接

3、编译

解压缩
tar xzf redis-7.4.1.tar.gz
编译
cd redis-7.4.1
make install
编译完成后,默认文件位置在: /usr/local/bin

4、配置

复制源代码文件解压目录下的redis.conf文件到/etc/redis.conf
cp redis.conf /etc/redis.conf
修改/etc/redis.conf配置文件
需要修改2处。
bing 0.0.0.0 # 绑定全部IP
requirepass mypassword #设置密码为mypassword

5、服务和开机启动

新建一个配置文件
vim /etc/systemd/system/redis.service
文件内容为:

redis.service文件内容
[Unit]
Description=redis
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/redis-server /etc/redis.conf
ExecReload=/usr/local/bin/redis-server -s reload
ExecStop=/usr/local/bin/redis-server -s stop
PrivateTmp=true

[Install]
WantedBy=multi-user.target

重新载入服务配置
systemctl daemon-reload

启动redis
systemctl start redis

设置开机启动redis
systemctl enable redis

6、清理

建议删除解压出来的redis-7.4.1目录。

posted on   Caraxes  阅读(376)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
点击右上角即可分享
微信分享提示