#!/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
redis4.0.8单点安装脚本
最新推荐文章于 2024-07-05 13:29:04 发布