linux安装redis脚本,一键安装redis,centos安装redis教程文档

版权声明:本文为作者原创文章,转载请附上原文出处链接和本声明。
本文链接:http://doc.shulijp.com/jdetail/1617697197103

#!/bin/bash
echo "install c++ ..."
yum install gcc-c++
yum -y install cpp binutils glibc glibc-kernheaders glibc-common glibc-devel gcc make gcc-c++ libstdc++-devel tcl

cd /data
echo "download redis file ..."
wget -nc http://download.redis.io/releases/redis-3.0.7.tar.gz 
tar -zxvf redis-3.0.7.tar.gz  -C /usr/local/
cd /usr/local/redis-3.0.7
make && make install PREFIX=/usr/local/redis 

cd /usr/local/redis/bin/
cp /usr/local/redis-3.0.7/redis.conf ./

echo 'requirepass mfc666@@@' >> redis.conf

echo " change 37 daemonize 'no' to 'yes' "
sed -i 's/daemonize no/daemonize yes/g' redis.conf


echo " start redis ... "
./redis-server redis.conf

echo " connect redis cmd '/usr/local/redis/bin/redis-cli'   ...  auth 'mfc666@@@' "

redis安装路径:

/usr/local/redis/

redis链接命令:

/usr/local/redis/bin/redis-cli

链接密码就是脚本中的 mfc666@@@ 需要自行修改

有什么问题留言咨询——点心工具

还能输入1000个字符