Skip to content

Commit

Permalink
. : added Procfile.learner
Browse files Browse the repository at this point in the history
Added Procfile.learner to easily start cluster with learner
Modified README.md to highlight its usage
Update review comments
  • Loading branch information
vimalk78 committed Sep 5, 2019
1 parent fb41ebe commit 53fd227
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ etcd1: bin/etcd --name infra1 --listen-client-urls http://127.0.0.1:2379 --adver
etcd2: bin/etcd --name infra2 --listen-client-urls http://127.0.0.1:22379 --advertise-client-urls http://127.0.0.1:22379 --listen-peer-urls http://127.0.0.1:22380 --initial-advertise-peer-urls http://127.0.0.1:22380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state new --enable-pprof --logger=zap --log-outputs=stderr
etcd3: bin/etcd --name infra3 --listen-client-urls http://127.0.0.1:32379 --advertise-client-urls http://127.0.0.1:32379 --listen-peer-urls http://127.0.0.1:32380 --initial-advertise-peer-urls http://127.0.0.1:32380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state new --enable-pprof --logger=zap --log-outputs=stderr
#proxy: bin/etcd grpc-proxy start --endpoints=127.0.0.1:2379,127.0.0.1:22379,127.0.0.1:32379 --listen-addr=127.0.0.1:23790 --advertise-client-url=127.0.0.1:23790 --enable-pprof

# A learner node can be started using Procfile.learner
11 changes: 11 additions & 0 deletions Procfile.learner
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Use goreman to run `go get github.com/mattn/goreman`

# 1. Start the cluster using Procfile
# 2. Add learner node to the cluster
# % etcdctl member add infra4 --peer-urls="http://127.0.0.1:42380" --learner=true

# 3. Start learner node with goreman
etcd4: bin/etcd --name infra4 --listen-client-urls http://127.0.0.1:42379 --advertise-client-urls http://127.0.0.1:42379 --listen-peer-urls http://127.0.0.1:42380 --initial-advertise-peer-urls http://127.0.0.1:42380 --initial-cluster-token etcd-cluster-1 --initial-cluster 'infra4=http://127.0.0.1:42380,infra1=http://127.0.0.1:12380,infra2=http://127.0.0.1:22380,infra3=http://127.0.0.1:32380' --initial-cluster-state existing --enable-pprof --logger=zap --log-outputs=stderr

# 4. The learner node can be promoted to voting member by the command
# % etcdctl member promote <memberid>
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ This will bring up 3 etcd members `infra1`, `infra2` and `infra3` and etcd `grpc

Every cluster member and proxy accepts key value reads and key value writes.

Follow the steps in [Procfile.learner](./Procfile.learner) to add a learner node to the cluster. Start the learner node with:

```bash
goreman -f ./Procfile.learner start
```

### Next steps

Now it's time to dig into the full etcd API and other guides.
Expand Down

0 comments on commit 53fd227

Please sign in to comment.