You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
980 B
33 lines
980 B
mkdir /usr/local/redis/
|
|
wget https://download.redis.io/releases/redis-7.0.9.tar.gz
|
|
tar -xf redis-7.0.9.tar.gz
|
|
cd redis-7.0.9
|
|
make PREFIX=/usr/local/redis install -j4
|
|
|
|
cp redis.conf /usr/local/redis/bin/
|
|
|
|
# 不管有用没用,先一下再说
|
|
cd /usr/local/redis/bin && rm -rf dump.rdb
|
|
|
|
sed -i 's#6379#18890#g' /usr/local/redis/bin/redis.conf
|
|
sed -i 's#bind 127.0.0.1 -::1#bind 0.0.0.0#g' /usr/local/redis/bin/redis.conf
|
|
sed -i 's#daemonize no#daemonize yes#g' /usr/local/redis/bin/redis.conf
|
|
sed -i 's#protected-mode yes#protected-mode no#g' /usr/local/redis/bin/redis.conf
|
|
sed -i 's/# save "/save "/g' /usr/local/redis/bin/redis.conf
|
|
|
|
# 杀进程
|
|
ps -ef |grep redis |awk '{print $2}'|xargs kill -9
|
|
|
|
|
|
# 启动
|
|
cd /usr/local/redis/bin/ && ./redis-server redis.conf
|
|
|
|
# 添加到启动
|
|
echo "cd /usr/local/redis/bin/ && ./redis-server redis.conf " >> /etc/rc.local
|
|
chmod +x /etc/rc.d/rc.local
|
|
|
|
# 验证启动
|
|
netstat -lntup |grep redis
|
|
|
|
|