Deployment of 3 from 3 main cluster pseudo-redis

安装redis
mkdir -p /data/apps
yum -y install gcc tcl make gcc++
wget http://download.redis.io/releases/redis-4.0.0.tar.gz
tar xzf redis-4.0.0.tar.gz
cd redis-4.0.0
make && make install PREFIX=/data/apps/redis
cd /data/apps/redis
mkdir conf
cp /opt/redis-4.0.0/redis.conf ./conf
useradd -M redis
chown -R redis.redis /data/apps/redis
chmod g+s /data/apps/redis

Cluster -pv mkdir / {7000,7007,7002,7003,7004,7005}
CP the conf / redis.conf Cluster / 7000 / redis.conf
CD Cluster
Vim 7000 / redis.conf
# port number
Port 7000
# backgrounding
to daemonize Yes
# Enable the cluster
cluster-enabled yes
node cluster configuration file #
cluster nodes-config-file-7000.conf
# cluster connection timeout
cluster-node-timeout 5000
file location # pid process of
the PidFile /var/run/redis-7000.pid
# open AOF of
appendOnly yes
# AOF of file path
appendFileName "appendOnly-7005.aof"
# RDB file path
dbfilename dump-7000.rdb


cp 7000/redis.conf ./{7001,7002,7003,7004,7005}/
sed -i 's/7000/7001/p' cluster/7001/redis.conf
sed -i 's/7000/7002/p' cluster/7002/redis.conf
sed -i 's/7000/7003/p' cluster/7003/redis.conf
sed -i 's/7000/7004/p' cluster/7004/redis.conf
sed -i 's/7000/7005/p' cluster/7005/redis.conf


cat <<EOF > start.sh
bin/redis-server cluster/7000/redis.conf
bin/redis-server cluster/7001/redis.conf
bin/redis-server cluster/7002/redis.conf
bin/redis-server cluster/7003/redis.conf
bin/redis-server cluster/7004/redis.conf
bin/redis-server cluster/7005/redis.conf

chmod +x start.sh
./start.sh


安装ruby
yum install ruby rubygems -y
gem install redis -y

Installation rvm

1 import keys
gpg the --keyserver HKP: //keys.gnupg.net --recv-Keys 409B6B1796C275462A1703113804BB82D39DC0E3
** or suggested that no valid OpenPGP data, perform
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -

2. 安装rvm
curl -sSL https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 2.3.0
rvm use 2.3.0 --default
ruby -v
gem -v

** modify the default source gem
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/


redis-trib create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005

Guess you like

Origin www.cnblogs.com/ray-mmss/p/12146379.html