(整理)REHL6.5_Yum安裝Reids

1.yum添加epel源

         yum install epel-releasehtml

          默認安裝,遇到「肯定嗎?」輸入Yjava

      

2.yum安裝Redisredis

        yum install redis  默認安裝,遇到「肯定嗎?」輸入Y,同上圖vim

3.設置守護進程
      Redis守護進程默認不啓動,所以找到redis.conf ,修改 daemonize no(128行) 爲 daemonize yes    centos

       vim  /etc/redis.conf測試

       vim:set number或者num(顯示行號)server

 4.服務端啓動       

        redis-server /etc/redis.confhtm

 5 服務端中止

        /etc/init.d/redis stop/start/Restartblog

        

        遇到這個錯誤,是由於沒有文件/var/log/Redis/Redis.log,使用touch建立這個文件,而後chmod 命令添加權限,而後start和Restart便可使用。進程

          touch /var/log/redis/redis-server.log

          chmod 777 /var/log/redis/redis-server.log

6.查看版本

          redis-server -v

7.測試啓動

         redis-cli ping 返回PONG,啓動成功。

8遠程訪問

  •       防火牆添加端口,而後重啓:Reids默認端口是6379
  •      redis.conf修改:在bind 127.0.0.1前面加#,屏蔽綁定的地址
  •      redis.conf修改:設置protected-mode no
 

參考資料

centos6.5 yum安裝redis:http://www.javashuo.com/article/p-wydokqlo-ec.html

Redis默認配置:http://www.javashuo.com/article/p-eapbamhf-gp.html

Linux編譯安裝Redis:https://www.cnblogs.com/superfat/p/5221829.html

vim顯示行號:https://jingyan.baidu.com/article/908080220bedeafd91c80fee.html

Redis遠程:https://www.cnblogs.com/liusxg/p/5712493.html

相關文章
相關標籤/搜索