#离线安装redis-cluster https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.gz
#安装ruby
tar xf ruby-2.4..tar.gz
cd ruby-2.4./
./configure --prefix=/usr/local/ruby
make && make insta
echo "PATH=$PATH:/usr/local/ruby/bin/" >>/etc/profile
source /etc/profile
ruby -v https://rubygems.org/downloads/redis-4.0.3.gem
#安装配置rubygems的redisapi
cd /usr/local/src/
gem install -l redis-4.0..gem
gem list redis https://sourceforge.net/projects/tcl/files/Tcl/8.6.0/
#安装tcl
unzip tcl868-src.zip
cd tcl8.6.8/unix/
./configure --prefix=/usr/local/tcl
make && make install
make install-private-headers
echo "PATH=$PATH/usr/local/tcl/bin/" >>/etc/profile
. /etc/profile http://download.redis.io/releases/redis-4.0.11.tar.gz
#安装redis
tar xf redis-4.0..tar.gz
cd redis-4.0./
make PREFIX=/usr/local/redis install
cp /usr/local/src/redis-4.0./src/redis-trib.rb /usr/local/redis/bin/
#redis配置
bind 0.0.0.0
port
tcp-backlog
timeout
tcp-keepalive
daemonize yes
supervised no
pidfile "/var/run/redis_7000.pid"
loglevel notice
logfile "/var/log/redis_7000.log"
databases
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /tmp/
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay
repl-disable-tcp-nodelay no
slave-priority
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit
cluster-enabled yes
cluster-config-file nodes-.conf
cluster-node-timeout
slowlog-log-slower-than
slowlog-max-len
latency-monitor-threshold
notify-keyspace-events ""
hash-max-ziplist-entries
hash-max-ziplist-value
list-max-ziplist-size -
list-compress-depth
set-max-intset-entries
zset-max-ziplist-entries
zset-max-ziplist-value
hll-sparse-max-bytes
activerehashing yes
client-output-buffer-limit normal
client-output-buffer-limit slave 256mb 64mb
client-output-buffer-limit pubsub 32mb 8mb
hz
aof-rewrite-incremental-fsync yes
for i in {..};do cp redis_7000.conf redis_${i}.conf;sed -i "s#7000#${i}#g" redis_${i}.conf;done
[root@serverscripts]#ll /usr/local/redis/conf/
total
-rw-r--r-- root root Nov : redis_7000.conf
-rw-r--r-- root root Nov : redis_7001.conf
-rw-r--r-- root root Nov : redis_7002.conf
-rw-r--r-- root root Nov : redis_7003.conf
-rw-r--r-- root root Nov : redis_7004.conf
-rw-r--r-- root root Nov : redis_7005.conf #启动
for i in `ls ./`;do /usr/local/redis/bin/redis-server ./$i;done #创建集群
/usr/local/redis/bin/redis-trib.rb create --replicas 1 10.0.0.100: 10.0.0.100: 10.0.0.100: c 10.0.0.100: 10.0.0.100: 10.0.0.100: