CentOS Redis 3 and 6.8 installed on the startup script, strong Redis is not to say, and directly see the following article explain.
Step 1: Download, compile and install
cd /opt
wget http://download.redis.io/releases/redis-3.2.5.tar.gz
tar zxvf redis-3.2.5.tar.gz
cd redis-3.2.5
yum install -y gcc*
yum install -y tcl
make MALLOC=libc
make
make test
cd deps
make hiredis jemalloc linenoise lua geohash-int
cd ..
make install
[root@cluster1 redis-3.2.5]# cd utils/
[root@cluster1 utils]# ls
build-static-symbols.tcl corrupt_rdb.c generate-command-help.rb hyperloglog lru redis_init_script redis-sha1.rb speed-regression.tcl
cluster_fail_time.tcl create-cluster hashtable install_server.sh redis-copy.rb redis_init_script.tpl releasetools whatisdoing.sh
[root@cluster1 utils]# chmod +x install_server.sh
[root@cluster1 utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default – /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default – /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default – /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service…
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server…
Installation successful!
daemonize no
port 6379
logfile “”
pidfile /var/run/redis.pid
# requirepass foobared
dir ./
daemonize yes
port 6379
logfile “/var/log/redis/6379.log”
pidfile /var/run/redis_6379.pid
requirepass 9k3NgZq%gO
dir /data/redis
grep vm.overcommit_memory /etc/sysctl.conf
echo “vm.overcommit_memory = 1” >> /etc/sysctl.conf
sed -i “s/vm.overcommit_memory = 0/vm.overcommit_memory = 1/g” /etc/sysctl.conf
sysctl -p
Redis
chkconfig redis on
chkconfig –list redis
service redis start
service redis stop
update Redis on CentOS 6.5
First, make sure the following repos, EPEL and REMI, are installed:
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm
Check the version of Redis in REMI repo: (As of June 2015, the version is 2.8.13)
yum –enablerepo=remi info redis
Then install related dependency (jemalloc) from EPEL repo:
sudo yum –enablerepo=epel install jemalloc
Before installation, you should stop the old Redis daemon:
sudo service redis stop
Then install the newer version of Redis:
sudo yum –enablerepo=remi install redis
Edit Redis configuration file if needed:
sudo vi /etc/redis.conf
Restart Redis daemon, and make it auto-start on reboot:
sudo service redis start
sudo chkconfig redis on
Finally, check the version of currently installed Redis:
redis-cli info | grep redis_version
Recent Comments