Centos7 redis3.2.3 installation process, centos7redis3.2.3

Source: Internet
Author: User

Centos7 redis3.2.3 installation process, centos7redis3.2.3

1: install wget: yum install wget
2: Install pip:
1: sudo yum-y install epel-release
2: sudo yum-y install python-pip
3: Install redis:
1: wget -- no-check-certificate http://download.redis.io/releases/redis-3.2.3.tar.gz
2: tar xzf redis-3.2.3.tar.gz
3: Music redis-3.2.3 usr/local/redis-3.2.3
4: cd usr/loacl/redis-3.2.3
5: make
6: Set auto-start upon startup:
1: Set daemonize in redis. conf to yes
2: Set logfile in redis. conf to "/var/log/redis. log"
2: Write the boot script
Vi/etc/init. d/redis
Redis content is:
"""


# Chkconfig: 2345 10 90
# Description: Start and Stop redis

PATH =/usr/local/bin:/sbin:/usr/bin:/bin
REDISPORT = 6379
EXEC =/usr/local/redis-3.2.3/src/redis-server
REDIS_CLI =/usr/local/redis-3.2.3/src/redis-cli

PIDFILE =/var/run/redis. pid
CONF = "/usr/local/redis-3.2.3/redis. conf"

Case "$1" in
Start)
If [-f $ PIDFILE]
Then
Echo "$ PIDFILE exists, process is already running or crashed ."
Else
Echo "Starting Redis server ..."
$ EXEC $ CONF
Fi
If ["$? "=" 0 "]
Then
Echo "Redis is running ..."
Fi
;;
Stop)
If [! -F $ PIDFILE]
Then
Echo "$ PIDFILE exists, process is not running ."
Else
PID = $ (cat $ PIDFILE)
Echo "Stopping ..."
$ REDIS_CLI-p $ REDISPORT SHUTDOWN
Sleep 2
While [-x $ PIDFILE]
Do
Echo "Waiting for Redis to shutdown ..."
Sleep 1
Done
Echo "Redis stopped"
Fi
;;
Restart | force-reload)
$ {0} stop
$ {0} start
;;
*)
Echo "Usage:/etc/init. d/redis {start | stop | restart | force-reload}"> & 2
Exit 1
Esac

"""

4: chmod + x/etc/init. d/redis
5:/etc/init. d/redis start
6: Set boot self-start: sudo chkconfig redis on

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.