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/

  • 相关阅读:
    多线程总结三:控制线程
    ios -- 为导航栏添加播放动画
    IOS -- UITableView里面点击一个cell改变其他cell的设置
    IOS -- UICollectionView里面的cell点击,点击一个cell改变其他cell的状态
    ios -- Masonry 更新约束
    IOS--按钮里面 左边文字右边图片的设置
    IOS--时间 NSDate,NSTimeInterval的一些转换
    IOS--通过宽度算高度
    iOS App中添加半透明新手指引
    IOS--解决tableview里面cell 文本输入框键盘遮盖的问题
  • 原文地址:https://www.cnblogs.com/ilovewindy/p/4544483.html
Copyright © 2011-2022 走看看