码迷,mamicode.com
首页 > 其他好文 > 详细

centos安装redis

时间:2020-01-21 21:59:13      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:ade   release   pid   malloc   prot   模式   img   关闭   modified   

1、下载redis安装包

wget http://download.redis.io/releases/redis-4.0.6.tar.gz

  

2、解压安装包

tar -zxvf redis-4.0.6.tar.gz

 

3、安装gcc依赖

yum install gcc

 

4、进入安装包

cd redis-4.0.6

 

  

5、安装编译(注意大小写)

make MALLOC=libc    

  

6、启动

修改redis.conf文件

daemonize no

修改成

daemonize yes  

 

增加注释

bind 127.0.0.1  修改为    #bind 127.0.0.1

  

关闭保护模式

protected-mode yes  修改为  protected-mode no

 

启动redis

进入文件的src目录

./redis-server ../redis.conf 

 显示以下内容,启动成功

[root@host-172-16-2-46 src]# ./redis-server ../redis.conf 
1102:C 21 Jan 20:52:30.868 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1102:C 21 Jan 20:52:30.869 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=1102, just started
1102:C 21 Jan 20:52:30.869 # Configuration loaded

  

 

 7、设置密码

redis默认没有设置密码,如果要设置密码,首先找到redis.conf文件;然后修改里面的requirepass,将注释去掉,并将后面对应的字段设置成自己想要的密码,保存即可。

技术图片

 

 设置好之后 重启redis

 

  

 

centos安装redis

标签:ade   release   pid   malloc   prot   模式   img   关闭   modified   

原文地址:https://www.cnblogs.com/pxblog/p/12225758.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!