阿里云-Centos7安装Redis

Redis安装

redis安装

1.下载redis
	wget http://download.redis.io/releases/redis-6.0.5.tar.gz
2.编译安装ngnix
	(1)进入 目录cd /data/soft
	(2)解压 tar xzf redis-6.0.5.tar.gz -C /data/server/
	(3)进入 cd /data/server/redis-6.0.5
	

编译安装redis

make
make install
遇到的问题
make时报错make[1]: *** [server.o]
原因:gcc版本低
处理:
yum -y install centos-release-scl

yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash

echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile

gcc -v

配置管理

vim redis.conf
# 注释掉绑定的主机,否则客户端无法连接

# bind 127.0.0.1

# 后台方式允许
daemonize改为no
daemonize yes

启动命令

 启动服务端: src/redis-server redis.conf
  以进程的方式启动:redis-server /redis-6.0.5/redis.conf

 
[root@iZ2ze5y0zrhwsd8mdofyapZ redis-6.0.5]# src/redis-server redis.conf
6095:C 06 Jun 2021 10:38:28.542 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
6095:C 06 Jun 2021 10:38:28.542 # Redis version=6.0.5, bits=64, commit=00000000, modified=0, pid=6095, just started
6095:C 06 Jun 2021 10:38:28.542 # Configuration loaded
[root@iZ2ze5y0zrhwsd8mdofyapZ redis-6.0.5]# ps -aux | grep redis
root      6096  0.1  0.1 162360  2532 ?        Ssl  10:38   0:00 src/redis-server *:6379
root      6102  0.0  0.0 112816   980 pts/1    R+   10:39   0:00 grep --color=auto redis
 启动客户端:src/redis-cli

设置以及基本使用

启动客户端:src/redis-cli
---设置密码
127.0.0.1:6379>  config get requirepass
1) "requirepass"
2) ""
127.0.0.1:6379> 
127.0.0.1:6379> config set requirepass 123456
OK
 

阿里云开端口

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值