CentOS 6.5 Installation Redis-3.2.6

Source: Internet
Author: User
Tags deprecated redis server

Download the latest version of Redis-3.2.6 on the website,

I put it in the folder:/usr/local/src/lnmp-7/source2/redis

Installation Script redis-3.2.6.sh
#!/bin/bashpath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATHif [[$EUID-ne 0]]; Thenecho "This script must is run as root" exit 1fisetenforce 0 # is temporarily disabled and does not require a restart (recommended). ##################################################### Installation Tool ################################################# #yum Install Gcc-c++yum install-y Tclyum installed wget##################################################### installation redis####### ########################################## #cd/USR/LOCAL/SRC/LNMP-7/SOURCE2/REDISTAR-XZVF. Redis-3.2.6.tar.gzmkdir-pv/usr/local/redis/redis-3.2.6\cp-rf./redis-3.2.6/*/usr/local/redis/redis-3.2.6cd/usr/ local/redis/redis-3.2.6# test REDISMAKECD srcmake test# configuration redismkdir/usr/local/redis/redis-3.2.6/etc\cp-rf/usr/local/ src/lnmp-7/config/redis-3.2.6/redis.conf/usr/local/redis/reids-3.2.6/etc/redis.conf# boot Up (deprecated) # echo "/usr/local/ Redis/redis-3.2.6/src/redis-server/usr/local/redis/redis-3.2.6/etc/redis.conf & ">>/etc/rc.local# start Redis (deprecated) #/usr/local/redis/redis-3.2.6/src/redis-server/usr/local/redis/redis-3.2.6/etc/redis.conf set up Redis boot \cp-rf/usr/ Local/src/lnmp-7/config/redis-3.2.6/redis.init/etc/rc.d/init.d/redis # Copy Redis.init to startup directory chmod +x/etc/rc.d/init.d/ Redis # Add Execute Permissions chkconfig redis on # Set boot service redis start # start Redis
/usr/local/redis/reids-3.2.6/etc/redis.conf content is as follows:
Bind 127.0.0.1protected-mode yesport 6379tcp-backlog 511timeout 0tcp-keepalive 300daemonize yessupervised nopidfile/ Var/run/redis.pidloglevel noticelogfile "" Databases 16save 1save 10save 10000stop-writes-on-bgsave-error Yesrdbcompression yesrdbchecksum Yesdbfilename Dump.rdbdir/usr/local/redis/dataslave-serve-stale-data Yesslave-read-only Yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100requirepass 52php-wenjianbaomaxclients 1024maxmemory 1gbmaxmemory-policy allkeys-lruappendonly yesappendfilename "Appendonly.aof" Appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated Yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events "" Hash-max-ziplist-entries 128hash-max-ziplist-value 1024list-max-ziplist-size-2list-compress-depth 0set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-Value 64hll-sparse-max-bytes 3000activerehashing yesclient-output-buffer-limit Normal 0 0 0client-output-buffer-limit Slave 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8MB 60hz 10aof-rewrite-incremental-fsync Yes

More detailed Description: Redis-3.2.6 configuration file Chinese translation

/etc/init.d/redis file contents are as follows
# chkconfig:2345 90# Description:start and Stop redispath=/usr/local/bin:/sbin:/usr/bin:/binredisport=6379 # port exec= /usr/local/redis/redis-3.2.6/src/redis-server # Service Program REDIS_CLI=/USR/LOCAL/REDIS/REDIS-3.2.6/SRC/REDIS-CLI #                Command-line program pidfile=/var/run/redis.pidconf= "/usr/local/redis/redis-3.2.6/etc/redis.conf" # config file case "$" 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 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: $ start|stop|restart|force-reload}" >&2 exit 1esac

CentOS 6.5 Installation Redis-3.2.6

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.