Centos installation Redis

Source: Internet
Author: User

1. Installing TCL support

Yum Install Tcl

2. Installing Redis We take the latest 2.8.9 as an example

$ wget http://download.redis.io/releases/redis-2.8.9.tar.gz$ tar xzf redis-2.8. 9 . tar.gz$ CD Redis-2.8. 9 $ make$ Make test$ make install

After the test is installed, the Redis-server,redis-cli,redis-benchmark,redis-check-aof,redis-check-dump is automatically copied to the/usr/local/bin directory after installation.

Edit the redis.conf file, which is inside the unpacked package

VI redis.conf

Change Daemonize No to Yes.

We manually copy the redis.conf to/etc directory

CP Redis.conf/etc

Set boot up

Under the/etc/init.d/directory, create a Redis file

########################### #chkconfig:2345 Ten  -#description: Start and Stop Redispath=/usr/local/bin:/sbin:/usr/bin:/bin Redisport=6379EXEC=/usr/local/bin/redis-serverredis_cli=/usr/local/bin/redis-CLI Pidfile=/var/run/redis.pidconf="/etc/redis.conf"    Case " $" inchstart)if[ -F $PIDFILE] then echo"$PIDFILE exists, process is already running or crashed"        ElseEcho"starting Redis Server ..."$EXEC $CONF fiif["$?"="0"] then echo"Redis is running ..."fi;; Stop)if[ ! -F $PIDFILE] then echo"$PIDFILE does not exist, process was not running"        ElsePID=$ (cat $PIDFILE) echo"stopping ..."$REDIS _cli-P $REDISPORT SHUTDOWN while[ -x ${pidfile}] DoEcho"waiting for Redis to shutdown ..."Sleep1Done Echo"Redis stopped"fi;; Restart|force-Reload) ${0} stop ${0} start; *) echo"Usage:/etc/init.d/redis {start|stop|restart|force-reload}">&2Exit1esac##############################

Modify permissions, you can run

chmod +x/etc/init.d/redis

Set up start-up service automatically

sudo chkconfig redis on

Start the service:

Service Redis Start

Stop service:

Service Redis Stop

Reference article: Http://www.cnblogs.com/duyinqiang/p/5696490.html & http://www.cnblogs.com/hanyinglong/p/5036558.html

Centos installation Redis

Related Article

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.