zoukankan      html  css  js  c++  java
  • How to install redis server on CentOS 7 / RHEL 7

    How to install redis server on CentOS 7 / RHEL 7

    In this tutorial we will learn, how to install redis server on CentOS 7 / RHEL 7 . The abbreviation of redis is REmote DIctionary Server. It is one the of the most popular open source,advanced key-value cache and store.

    Project URL : http://redis.io/

    Follow the given below steps to install redis server on CentOS 7 and Red Hat Enterprise Linux 7.

    Install wget utility

    Install wget command

    yum install wget

    Install EPEL repo

    First we will install the EPEL repo. For more detail on EPEL repo, we suggest you to read our this post.

    Because our system has x86_64 Operating System architecture, we will use only epel repo package for x86_64 . Search epel repo package as per your Operating System architecture(EPEL URL)

    wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/e/
    
    rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-*.rpm

    It will create two epel’s repo file inside /etc/yum.repos.d
    These are –
    1. epel.repo
    2.epel-testing.repo

    [root@localhost ~]# ls -l /etc/yum.repos.d/
    total 28
    -rw-r--r--. 1 root root 1612 Jul  4 07:00 CentOS-Base.repo
    -rw-r--r--. 1 root root  640 Jul  4 07:00 CentOS-Debuginfo.repo
    -rw-r--r--. 1 root root 1331 Jul  4 07:00 CentOS-Sources.repo
    -rw-r--r--. 1 root root  156 Jul  4 07:00 CentOS-Vault.repo
    -rw-r--r--. 1 root root  957 Sep  2 12:14 epel.repo
    -rw-r--r--. 1 root root 1056 Sep  2 12:14 epel-testing.repo
    [root@localhost ~]#

    Install redis server

    Now use yum command to install redis server

    yum install redis

    Two important redis server configuration file’s path
    1. /etc/redis.conf
    2. /etc/redis-sentinel.conf

    Now start the redis server after this.

    systemctl start redis.service

    Check the running status of redis server

    systemctl status redis.service

    To test the installation of Redis, use below given command

    redis-cli ping

    If the response output is PONG, it means installation is completed successfully.

    [root@localhost ~]# redis-cli ping
    PONG
    [root@localhost ~]#

    Start/Stop/Restart/Status and Enable redis server

    To start redis server

    systemctl start redis.service

    To stop redis server

    systemctl stop redis.service

    To restart redis server

    systemctl restart redis.service

    To get running status of redis server

    systemctl status redis.service

    To enable redis server at system’s booting time.

    systemctl enable redis.service

    To disable redis server at system’s booting time.

    systemctl disable redis.service

    Listening Port Of Redis Server

    Redis Server listens by default at port number 6379. Use below given ss command. (To learn more about ss command)

    [root@localhost ~]# ss -nlp|grep redis
    tcp    LISTEN     0      128            127.0.0.1:6379                  *:*      users:(("redis-server",19706,4))
    [root@localhost ~]#

    Note: On minimal installed CentOS 7/ RHEL 7,you wont get netstat command. Instead of netstat command, use ss command which is by default available on system.

    Learn Redis : http://redis.io/documentation

    Who is using redis: Who is using Redis

    from: http://sharadchhetri.com/2014/10/04/install-redis-server-centos-7-rhel-7/

  • 相关阅读:
    Yii1.1框架关于日志的配置的简单使用
    jQuery基础语法知识梳理
    PHP信用卡卡号验证函数
    Linux安装Apache常见报错(二)
    Linux安装Apache常见报错(一)
    【转】程序员常访问的国外技术交流网站汇总
    Zabbix之六----Zabbix监控memcached、redis、nginx及邮件分级报警通知
    Zabbix之五---Zabbix监控TCP连接数
    Zabbix之四---Zabbix主被动模式监控、主被动模式proxy使用以及主动模式tomcat监控
    Zabbix之三---Zabbix监控Nginx服务及nginx的80端口状态
  • 原文地址:https://www.cnblogs.com/ilovewindy/p/4544483.html
Copyright © 2011-2022 走看看