Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
snower committed Aug 17, 2023
1 parent 735eb69 commit 1fe1b2f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
14 changes: 12 additions & 2 deletions README-zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ Succed

集群管理使用redis-cli,配置管理可在集群内任意节点完成。

slock自身具备良好多核支持,集群模式自身不能起到提高性能的作用,但可完成高可用,单一节点失效不影响整体服务可用性,节点宕机时秒级恢复集群可用,节点网络超时可在数秒内恢复集群可用。

!!!!注意:集群配置过程和MongoDB副本集初始化过程类似,添加的节点IP需要相互能访问,按以下配置示例自行配置时需要自行替换IP端口为节点间相互能访问的IP端口

!!!!(特别提醒:Docker容器内127.0.0.1不互通,需使用容器外IP端口 )。

### 集群创建示例

#### 第1步:启动集群节点
Expand All @@ -152,15 +158,17 @@ Succed
redis-cli -h 127.0.0.1 -p 5657
```

#### 第3步:配置初始化集群
#### 第3步:配置当前节点信息并初始化集群

```bash
# 在连接成功后的redis-cli中执行

replset config 127.0.0.1:5657 weight 1 arbiter 0
```

#### 第4步:添加其它节点
IP和端口必须为**当前节点**可被其它节点访问的外部IP和端口

#### 第4步:添加其它节点信息

```bash
# 在连接成功后的redis-cli中执行
Expand All @@ -170,6 +178,8 @@ replset add 127.0.0.1:5658 weight 1 arbiter 0
replset add 127.0.0.1:5659 weight 1 arbiter 0
```

IP和端口必须为**其它节点**可被当前节点访问的外部IP和端口

### 配置指令

```
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ Use the replset parameter to specify the cluster name to start as a cluster mode

Cluster management using redis-cli, configuration management can be done at any node in the cluster.

Slock itself has good multi-core support. The cluster mode itself cannot improve performance, but it can achieve high availability. The failure of a single node does not affect the overall service availability. When a node goes down, the cluster can be restored in seconds, and the node network timeout can be within seconds. The recovery cluster is available.

! ! ! ! Note: The cluster configuration process is similar to the MongoDB replica set initialization process. The IPs of the added nodes need to be accessible to each other. When configuring according to the following configuration example, you need to replace the IP port with the IP port that can be accessed by each other.

! ! ! ! (Special reminder: 127.0.0.1 in the Docker container is not interoperable, and the IP port outside the container needs to be used).

### Cluster creation examples

#### Step 1: Start cluster nodes
Expand All @@ -153,14 +159,16 @@ Cluster management using redis-cli, configuration management can be done at any
redis-cli -h 127.0.0.1 -p 5657
```

#### Step 3: Configure the initialized cluster
#### Step 3: Configure current node information and initialize the cluster

```bash
# Execute in redis-cli after a successful connection

replset config 127.0.0.1:5657 weight 1 arbiter 0
```

The IP and port must be the external IP and port of **current node** that can be accessed by other nodes

#### Step 4: Add other members

```bash
Expand All @@ -171,6 +179,8 @@ replset add 127.0.0.1:5658 weight 1 arbiter 0
replset add 127.0.0.1:5659 weight 1 arbiter 0
```

The IP and port must be the external IP and port of **other nodes** that can be accessed by the current node

### Configuration commands

```
Expand Down

0 comments on commit 1fe1b2f

Please sign in to comment.