Skip to content

Commit

Permalink
Refactor port for http-addr 8090->8700
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Feb 19, 2019
1 parent ae0a409 commit 2809170
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ func newStartCommand(ctx *cmdContext) *cobra.Command {
f.StringVar(&conf.SSLCertificateKey, "certificate-key", fmt.Sprintf("%s/%s", ctx.path, "server.key"), "Server key file")

f.StringVar(&conf.HTTPAddr, "http-addr", ":8800", "Endpoint for REST requests on (host:port)")
f.StringVar(&conf.RaftAddr, "raft-addr", "9000", "Raft bind address (host:port)")
f.StringVar(&conf.MgmtAddr, "mgmt-addr", "8090", "Management endpoint bind address (host:port)")
f.StringVar(&conf.MgmtAddr, "metrics-addr", "9990", "Metrics export bind address (host:port)")
f.StringVar(&conf.RaftAddr, "raft-addr", ":9000", "Raft bind address (host:port)")
f.StringVar(&conf.MgmtAddr, "mgmt-addr", ":8700", "Management endpoint bind address (host:port)")
f.StringVar(&conf.MgmtAddr, "metrics-addr", ":9990", "Metrics export bind address (host:port)")
f.StringSliceVar(&conf.RaftJoinAddr, "join-addr", []string{}, "Raft: Comma-delimited list of nodes ([host]:port), through which a cluster can be joined")
f.StringVar(&conf.GossipAddr, "gossip-addr", ":9100", "Gossip: management endpoint bind address (host:port)")
f.StringSliceVar(&conf.GossipJoinAddr, "gossip-join-addr", []string{}, "Gossip: Comma-delimited list of nodes ([host]:port), through which a cluster can be joined")
Expand Down
10 changes: 5 additions & 5 deletions config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ server:
certificate_key: "/var/tmp/qed/server.key" # Server certificate key file
addr:
http: ":8800" # Endpoint for REST requests on (host:port).
mgmt: ":8090" # Management endpoint bind address (host:port).
metrics: ":9990" # Metrics endpoint (host:port).
raft: ":9000" # Raft bind address (host:port).
raft_join: # Raft: list of nodes ([host]:port), through which a cluster can be joined.
- "127.0.0.1:9000"
mgmt: ":8700" # Management endpoint bind address (host:port).
metrics: ":9990" # Metrics endpoint (host:port). where raft node can join the current cluster
raft: ":9000" # Raft bind address (host:port). internal message passing
raft_join: # Raft: list of nodes ([host]:port), where the node can join the cluster using the mgmt endpoint
- "127.0.0.1:8700"
gossip: ":9100" # Gossip: management endpoint bind address (host:port).
gossip_join: # Gossip: list of nodes ([host]:port), through which a cluster can be joined.
- "127.0.0.1:9100"
Expand Down
10 changes: 5 additions & 5 deletions deploy/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module "leader" {
node_id: "leader"
addr:
http: ":8800"
mgmt: ":8090"
mgmt: ":8700"
raft: ":9000"
gossip: ":9100"
CONFIG
Expand All @@ -61,11 +61,11 @@ module "follower-1" {
node_id: "follower-1"
addr:
http: ":8800"
mgmt: ":8090"
mgmt: ":8700"
raft: ":9000"
gossip: ":9100"
raft_join:
- "${module.leader.private_ip}:9000"
- "${module.leader.private_ip}:8700"
gossip_join:
- "${module.leader.private_ip}:9100"
CONFIG
Expand All @@ -90,11 +90,11 @@ module "follower-2" {
node_id: "follower-2"
addr:
http: ":8800"
mgmt: ":8090"
mgmt: ":8700"
raft: ":9000"
gossip: ":9100"
raft_join:
- "${module.leader.private_ip}:9000"
- "${module.leader.private_ip}:8700"
gossip_join:
- "${module.leader.private_ip}:9100"
CONFIG
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ go run main.go start \
-y ~/.ssh/id_ed25519-qed \
--http-addr :8800 \
--raft-addr :9000 \
--mgmt-addr :8090 \
--mgmt-addr :8700 \
-l error
```

Expand All @@ -40,7 +40,7 @@ for i in $(seq 1 $FOLLOWERS); do
--raftpath $(mktemp -d /var/tmp/demo.XXX) \
-y ~/.ssh/id_ed25519-qed \
--http-addr :808$i \
--join-addr :8090 \
--join-addr :8700 \
--raft-addr :900$i \
--mgmt-addr :809$i \
--node-id node$i \
Expand Down
2 changes: 1 addition & 1 deletion server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func DefaultConfig() *Config {
NodeID: hostname,
HTTPAddr: "127.0.0.1:8800",
RaftAddr: "127.0.0.1:9000",
MgmtAddr: "127.0.0.1:8090",
MgmtAddr: "127.0.0.1:8700",
MetricsAddr: "127.0.0.1:9990",
RaftJoinAddr: []string{},
GossipAddr: "127.0.0.1:9100",
Expand Down
2 changes: 1 addition & 1 deletion tests/cloud/aws/templates/start_master
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo Create id_ed25519 key
yes | ssh-keygen -t ed25519 -N '' -f /var/tmp/id_ed25519

echo Starting server...
nohup /tmp/to_upload/qed start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr ${master_address}:8800 --raft-addr ${master_address}:9000 --mgmt-addr ${master_address}:8090 &
nohup /tmp/to_upload/qed start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr ${master_address}:8800 --raft-addr ${master_address}:9000 --mgmt-addr ${master_address}:8700 &
echo done.

sleep 10
2 changes: 1 addition & 1 deletion tests/cloud/aws/templates/start_slave01
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ yes | ssh-keygen -t ed25519 -N '' -f /var/tmp/id_ed25519
sleep 10

echo Starting slave01...
nohup /tmp/to_upload/qed start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr ${slave01_address}:8081 --join-addr ${master_address}:8090 --raft-addr ${slave01_address}:9001 --mgmt-addr ${slave01_address}:8091 --node-id slave1 &
nohup /tmp/to_upload/qed start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr ${slave01_address}:8081 --join-addr ${master_address}:8700 --raft-addr ${slave01_address}:9001 --mgmt-addr ${slave01_address}:8091 --node-id slave1 &
echo done.

sleep 10
2 changes: 1 addition & 1 deletion tests/cloud/aws/templates/start_slave02
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ yes | ssh-keygen -t ed25519 -N '' -f /var/tmp/id_ed25519
sleep 10

echo Starting slave02...
nohup /tmp/to_upload/qed start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr ${slave02_address}:8081 --join-addr ${master_address}:8090 --raft-addr ${slave02_address}:9001 --mgmt-addr ${slave02_address}:8091 --node-id slave2 &
nohup /tmp/to_upload/qed start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr ${slave02_address}:8081 --join-addr ${master_address}:8700 --raft-addr ${slave02_address}:9001 --mgmt-addr ${slave02_address}:8091 --node-id slave2 &
echo done.

sleep 10
2 changes: 1 addition & 1 deletion tests/demo/start-follower1
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
# limitations under the License.

echo 'Starting follower #1...'
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8081 --join-addr :8090 --raft-addr :9001 --mgmt-addr :8091 --node-id follower1
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8081 --join-addr :8700 --raft-addr :9001 --mgmt-addr :8091 --node-id follower1
echo done.
2 changes: 1 addition & 1 deletion tests/demo/start-follower2
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
# limitations under the License.

echo 'Starting follower #2...'
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8082 --join-addr :8090 --raft-addr :9002 --mgmt-addr :8092 --node-id follower2
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8082 --join-addr :8700 --raft-addr :9002 --mgmt-addr :8092 --node-id follower2
echo done.
2 changes: 1 addition & 1 deletion tests/demo/start-leader
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo Create id_ed25519 key
ssh-keygen -t ed25519 -N '' -f /var/tmp/id_ed25519

echo 'Starting leader...'
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8800 --raft-addr :9000 --mgmt-addr :8090
go run ../../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l debug --http-addr :8800 --raft-addr :9000 --mgmt-addr :8700
echo done.

echo Cleanup...
Expand Down
6 changes: 3 additions & 3 deletions tests/start_server
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ fi
if [ -z "$CLUSTER_SIZE" ]
then
echo Starting single server...
go run ../main.go start -k pepe -p /var/tmp/demo.dbpath --raftpath /var/tmp/demo.raftpath -y /var/tmp/id_ed25519 -l error --http-addr :8800 --raft-addr :9000 --mgmt-addr :8090 $PROFILING &
go run ../main.go start -k pepe -p /var/tmp/demo.dbpath --raftpath /var/tmp/demo.raftpath -y /var/tmp/id_ed25519 -l error --http-addr :8800 --raft-addr :9000 --mgmt-addr :8700 $PROFILING &
sleep 10
echo done.
else
echo Starting cluster mode...
go run ../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr :8800 --raft-addr :9000 --mgmt-addr :8090 $PROFILING &
go run ../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr :8800 --raft-addr :9000 --mgmt-addr :8700 $PROFILING &
sleep 10
echo Starting followers
for i in $(seq 1 $CLUSTER_SIZE); do
go run ../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr :880$i --join-addr :8090 --raft-addr :900$i --mgmt-addr :809$i --node-id node$i &
go run ../main.go start -k pepe -p $(mktemp -d /var/tmp/demo.XXX) --raftpath $(mktemp -d /var/tmp/demo.XXX) -y /var/tmp/id_ed25519 -l error --http-addr :880$i --join-addr :8700 --raft-addr :900$i --mgmt-addr :809$i --node-id node$i &
done
sleep 10
echo done.
Expand Down

0 comments on commit 2809170

Please sign in to comment.