diff options
| author | byte2016 <[email protected]> | 2018-08-28 14:56:56 +0800 |
|---|---|---|
| committer | byte2016 <[email protected]> | 2018-08-28 14:56:56 +0800 |
| commit | 067d4e6786f7f63fb6bb1b1136cad074675ed70b (patch) | |
| tree | ad2c0ed58cd6a9c6790d4b6d7e48f98bc0b16f87 /redis-node/run_redis.sh | |
Diffstat (limited to 'redis-node/run_redis.sh')
| -rw-r--r-- | redis-node/run_redis.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/redis-node/run_redis.sh b/redis-node/run_redis.sh new file mode 100644 index 0000000..f6c8ea0 --- /dev/null +++ b/redis-node/run_redis.sh @@ -0,0 +1,35 @@ +#/bin/bash +if [ $# -lt 1 ];then + echo -e "usage:\n\trun_redis.sh redis_instance_num\nexample:\n\trun_redis.sh 6" + exit 1 +fi + +killall redis-server +sleep 1 +n=$1 +echo $n +s=9001 +dir=/home/mesasoft/redis/redis-node/ +deldir=$dir"9*" +rm -rf $deldir +echo 16384 >> /proc/sys/net/core/somaxconn +echo 'ulimit -n 16384' >> /etc/profile +for((i=0;i<$n;i++)); +do + ((p=$s+$i)) + mkdir $p + node_dir=${dir}${p} + cd $node_dir + echo "include "$dir"redis_comm.conf" >> redis.conf + port="port "${p} + echo $port >> redis.conf + pidfile="pidfile "${node_dir}"/redis.pid" + echo $pidfile >> redis.conf + work_dir="dir "${node_dir} + echo $work_dir >> redis.conf + log="logfile "${node_dir}"/redis.log" + echo $log >> redis.conf + redis-server redis.conf + cd .. +done + |
