Linux下yum安裝Redis

檢驗是否有yum源:

[root@localhost ~]# yum install redis

顯示沒有軟件包Redis,安裝epel倉庫(提供一些RHEL/CentOS默認不提供的軟件包)。redis

[root@localhost ~]# yum install epel-release

完成後yum安裝Redis :

[root@localhost ~]# yum install redis

 

配置Redis: 

[root@localhost ~]# vim /etc/redis.conf 

其中主要的配置項有:vim

  • bind   綁定的IP
  • port   指定的端口,默認爲6379
  • requirepass  設定密碼

啓動服務:

[root@localhost ~]# redis-server /etc/redis.conf

從新開個會話窗口,查看是否啓動成功工具

[root@localhost ~]# ps -aux|grep redis

下圖表示啓動成功 ui

啓動成功,確保防火牆沒有禁止相關端口通常爲637九、6380,便可經過一些Redis工具來進行鏈接操做了。spa

相關文章
相關標籤/搜索