700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 腾讯云轻量服务器Centos 7.6安装redis 5.0.4教程

腾讯云轻量服务器Centos 7.6安装redis 5.0.4教程

时间:2020-04-26 02:23:41

相关推荐

腾讯云轻量服务器Centos 7.6安装redis 5.0.4教程

1. 在Redis官网下载redis,下载完后上传到服务器上。下载地址:Index of /releases/

2. 在/usr/local/目录下创建software文件夹,在software下创建redis文件夹

[root@VM-4-16-centos ~]# mkdie software[root@VM-4-16-centos ~]# cd software[root@VM-4-16-centos ~]# mkdie redis[root@VM-4-16-centos ~]# cd

3. 回到根目录,解压Redis到redis文件夹下

[root@VM-4-16-centos ~]# tar -zxvf redis-5.0.4.tar.gz -C /usr/local/software/redis/

4.安装gcc

[root@VM-4-16-centos redis-5.0.4]# yum install gcc-c++

5. 编译

[root@VM-4-16-centos redis-5.0.4]# make

6. 安装Redis,PREFIX=/usr/local/redis是安装路径

[root@VM-4-16-centos redis]# make install PREFIX=/usr/local/redis

7. 拷贝redis.conf文件到redis安装路径下

[root@VM-4-16-centos redis-5.0.4]# cp redis.conf /usr/local/redis/bin/

8. 编辑redis安装路径下的redis.conf

[root@VM-4-16-centos bin]# vim redis.conf

需要修改的地方:修改时可以使用 / 进行搜索,例如搜索bind配置,/bind 然后按n进行寻找

1. 修改bind 127.0.0.1

bind 127.0.0.1修改为bind 0.0.0.0

2. 修改 daemonize

daemonize no 修改为daemonizeyes

表示可以后台运行

3. 修改requirepass,这个是配置登录密码的

#requirepass foobared 修改为requirepass xxxxxx

说明:删除# 放开注释,后面的xxxxxx是需要使用的密码

4. 修改默认端口号(默认端口号是:6379) ,该项的修改可以根据自己的需求是否决定需要修改

port 6379 修改为 port xxxx

说明:xxxx是修改后的端口号,如果修改过端口号,需要将服务器上对应的端口号放开。腾讯云服务器是在 管理-防火墙,选择添加规则进行开放

9. 启动Redis

[root@VM-4-16-centos bin]# ./redis-server redis.conf

查看redis的启动:ps -ef | grep redis

10. 登录Redis客户端验证

[root@VM-4-16-centos bin]# ./redis-cli -h 127.0.0.1 -p 端口 -a 密码Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.127.0.0.1:6597>

如上表示已登录,然后可以使用一些Redis命令验证了

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。