Linux(centos,麒麟)下Redis使用RPM方式安装

一、安装包下载
redis安装包
http://cocobabi.vip/app/redis-3.2.12-2.el7.x86_64.rpm

依赖包
http://cocobabi.vip/app/jemalloc-3.6.0-1.el7.x86_64.rpm

二、安装
1、将文件放到/opt目录下
2、进入/opt目录# cd /opt
3、先执行依赖安装命令,再执行redis安装命令

[root@iZuf61gy3n1d12woog919aZ app]# rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm
warning: jemalloc-3.6.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:jemalloc-3.6.0-1.el7 ################################# [100%]
[root@iZuf61gy3n1d12woog919aZ app]# rpm -ivh redis-3.2.12-2.el7.x86_64.rpm
warning: redis-3.2.12-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:redis-3.2.12-2.el7 ################################# [100%]
4、启动redis

[root@iZuf61gy3n1d12woog919aZ app]# service redis start
Redirecting to /bin/systemctl start redis.service

三、配置
1、redis配置文件默认路径

/etc/redis.conf

2、修改配置文件

[root@iZuf61gy3n1d12woog919aZ html]# vim /etc/redis.conf
################################# GENERAL #####################################
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# 如果需要在其它地方远程redis,需要注释下面的一行
bind 127.0.0.1
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
# 启动守护进程
daemonize yes

3、设置密码

// 进入redis命令行
[root@iZuf61gy3n1d12woog919aZ html]# /usr/bin/redis-cli -p 6379
// 修改密码为123456
127.0.0.1:6379> config set requirepass 123456
127.0.0.1:6379> ok
// 需要使用密码重新进入redis
[root@iZuf61gy3n1d12woog919aZ html]# /usr/bin/redis-cli -p 6379 -a 123456
// 查询密码
127.0.0.1:6379> config get requirepass
1) "requirepass"
2) "123456"

 

4验证端口是否通

telnet 127.0.0.1:6379

posted on   大兄弟666  阅读(2008)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示