redis一键创建脚本
#!/bin/bash redispwd=cy@123456 mkdir /application/tools -p cd /application/tools wget http://download.redis.io/releases/redis-5.0.9.tar.gz tar xzf redis-5.0.9.tar.gz cd redis-5.0.9 yum install gcc gcc-c++ -y make cp /application/tools/redis-5.0.9/src/redis-server /application/tools/redis-5.0.9 cp /application/tools/redis-5.0.9/src/redis-cli /application/tools/redis-5.0.9 hostip=$(hostname -i) sed -i "s#bind 127.0.0.1#bind ${hostip}#" redis.conf sed -i "s#daemonize no#daemonize yes#" redis.conf sed -i "s#appendonly no#appendonly yes#" redis.conf meminfo=$(cat /proc/meminfo |grep MemTotal |awk -F ' ' '{print $2}') redismaxmemory=$((${meminfo}*1024*9/10)) sed -i "567a maxmemory ${redismaxmemory}" redis.conf sed -i "509a requirepass ${redispwd}" redis.conf nohup /application/tools/redis-5.0.9/redis-server /application/tools/redis-5.0.9/redis.conf &
一键创建redis单机, 默认密码cy@123456
螃蟹在剥我的壳,笔记本在写我,漫天的我落在枫叶上雪花上,而你在想我。
--章怀柔