centos7 3安裝redis4 0 8主從集群

2021-09-16 12:03:17 字數 2953 閱讀 5343

192.168.241.101 paascloud-redis-001

192.168.241.102 paascloud-redis-002

192.168.241.103 paascloud-redis-003

1
wget

1

2

# tar -zxvf redis-4.0.8.tar.gz -c /usr/local

# mv redis-4.0.8 redis

123

4

# mkdir -p /usr/local/redis/cluster-conf/7001

# mkdir -p /usr/local/redis/cluster-conf/7002

# cp /usr/local/redis/redis.conf /usr/local/redis/cluster-conf/7001

# cp /usr/local/redis/redis.conf /usr/local/redis/cluster-conf/7002

vim /usr/local/redis/cluster-conf/7001/redis.conf

123

4567

8910

port 7001

daemonize yes

/var/run/redis-7001.pid

logfile "/usr/local/redis/cluster-conf/7001/redis.log"

dir /usr/local/redis/cluster-conf/7002/

cluster-enabled yes

cluster-config-file /usr/local/redis/cluster-conf/7001/nodes.conf

cluster-node-timeout 15000

bind 0.0.0.0

vim /usr/local/redis/cluster-conf/7002/redis.conf

123

4567

8910

port 7002

daemonize yes

pidfile /var/run/redis-7002.pid

logfile "/usr/local/redis/cluster-conf/7002/redis.log"

dir /usr/local/redis/cluster-conf/7002/

cluster-enabled yes

cluster-config-file /usr/local/redis/cluster-conf/7002/nodes.conf

cluster-node-timeout 15000

bind 0.0.0.0

1

2

scp -r /usr/local/redis/ [email protected]:/usr/local/

scp -r /usr/local/redis/ [email protected]:/usr/local/

1
yum install -y gcc tcl ruby rubygems

1
make install prefix=/usr/local/redis

1
make malloc=libc

1

1

2

/usr/local/redis/bin/redis-server /usr/local/redis/cluster-conf/7001/redis.conf &

/usr/local/redis/bin/redis-server /usr/local/redis/cluster-conf/7002/redis.conf &

1
# gem install redis

1
# /usr/local/redis/src/redis-trib.rb create --replicas 1 192.168.241.101:7001 192.168.241.102:7001 192.168.241.103:7001 192.168.241.101:7002 192.168.241.102:7002 192.168.241.103:7002

1

2

# /usr/loca/redis/bin/redis-cli -c -p 7001

127.0.0.1:7001> cluster nodes

配置選項

選項值說明

daemonize

yes是否作為守護程序執行

pidfile

/var/run/redis-7001.pid

如以後臺程序執行,則需指定乙個pid 預設為/var/run/redis.pid

port

7001

監聽埠,預設為6379注意:集群通訊埠值預設為此埠值+10000,如17111

cluster-config-file

/usr/local/redis/cluster-conf/7001/nodes.conf

集群配置檔案(啟動自動生成),不用人為干涉

cluster-node-timeout

15000

節點互連超時時間。毫秒

yes啟用aof持久化方式

diryes

開啟redis集群

cluster-enabled

/usr/local/redis/cluster-conf/7001

節點資料持久化存放目錄

CentOS7 3 安裝Redis 阿里雲 親試

yum install redis service redis start 設定為開機自動啟動 chkconfig redis on redis cli如果報以下資訊,證明沒啟動redis could not connect to redis at 127.0.0.1 6379 connection...

CentOS7 3安裝部署wordpress

centos7.3安裝部署wordpresswordpress簡介 wordpress是使用php語言開發的部落格平台,使用者可以在支援php和mysql資料庫的伺服器上架設屬於自己的 也可以把 wordpress當作乙個內容管理系統 cms 來使用。root luchao yum install ...

CentOS 7 3 安裝 PYTHON 環境

centos 7.4 預設 帶了 個 python2.7 環境 然 現在主流都是 python3 所以接下來再裝 個 python3 打造 個共存的環境。tar zxvf python 3.8.6.tgz則可以在當前 錄得到 件夾 python 3.8.6直接執 如下命令即可 yum install...