redis4.0.8單點安裝腳本

#!/bin/bash

#This is a script to install redis, the source code is compiled and installed. The version number of redis is 4.0.8

#Installation dependency package

yum -y install gcc gcc-c++




#Download the installation package

wget http://download.redis.io/releases/redis-4.0.8.tar.gz



#Extract to the specified directory

tar zxvf redis-4.0.8.tar.gz -C /usr/src

cd /usr/src/redis-4.0.8/




#Compile and install

make MALLOC=libc

make && make install


mkdir -p /usr/local/redis/etc

mkdir -p /usr/local/redis/bin

mv /usr/src/redis-4.0.8/redis.conf /usr/local/redis/etc/

cd /usr/src/redis-4.0.8/src/

cp mkreleasehdr.sh redis-benchmark redis-check-aof redis-server redis-cli /usr/local/redis/bin


echo "PATH=$PATH:/usr/local/redis/bin" >> /etc/profile

sed -i 's/daemonize no/daemonize yes/' /usr/local/redis/etc/redis.conf

#Start service

cd /usr/local/redis/bin

redis-server /usr/local/redis/etc/redis.conf


setenforce 0

redis-cli -h 127.0.0.1 -p 6379
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章