Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
a2d16b52bb | |||
b637b3a607 | |||
0eba3c9000 | |||
c3aab42959 | |||
62560f9959 | |||
3c04f8b664 | |||
cc37c58103 |
@ -1205,21 +1205,22 @@ The configuration endpoint manages shared cluster wide properties.
|
|||||||
### Set Cluster Config
|
### Set Cluster Config
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -L http://127.0.0.1:7001/v2/admin/config -XPUT -d '{"activeSize":3, "promoteDelay":1800}'
|
curl -L http://127.0.0.1:7001/v2/admin/config -XPUT -d '{"activeSize":3, "removeDelay":1800,"syncInterval":5}'
|
||||||
```
|
```
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"activeSize": 3,
|
"activeSize": 3,
|
||||||
"promoteDelay": 1800
|
"removeDelay": 1800,
|
||||||
|
"syncInterval":5
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`activeSize` is the maximum number of peers that can join the cluster and participate in the consensus protocol.
|
`activeSize` is the maximum number of peers that can join the cluster and participate in the consensus protocol.
|
||||||
|
|
||||||
The size of cluster is controlled to be around a certain number. If it is not, it will promote standby-mode instances or demote peer-mode instances to make it happen.
|
The size of cluster is controlled to be around a certain number. If it is not, standby-mode instances will join or peer-mode instances will be removed to make it happen.
|
||||||
|
|
||||||
`promoteDelay` indicates the minimum length of delay that has been observed before promotion or demotion.
|
`removeDelay` indicates the minimum time that a machine has been observed to be unresponsive before it is removed from the cluster.
|
||||||
|
|
||||||
### Get Cluster Config
|
### Get Cluster Config
|
||||||
|
|
||||||
@ -1230,6 +1231,61 @@ curl -L http://127.0.0.1:7001/v2/admin/config
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"activeSize": 3,
|
"activeSize": 3,
|
||||||
"promoteDelay": 1800
|
"removeDelay": 1800,
|
||||||
|
"syncInterval":5
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Remove Machines
|
||||||
|
|
||||||
|
At times you may want to manually remove a machine. Using the machines endpoint
|
||||||
|
you can find and remove machines.
|
||||||
|
|
||||||
|
First, list all the machines in the cluster.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -L http://127.0.0.1:7001/v2/admin/machines
|
||||||
|
```
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"clientURL": "http://127.0.0.1:4001",
|
||||||
|
"name": "peer1",
|
||||||
|
"peerURL": "http://127.0.0.1:7001",
|
||||||
|
"state": "leader"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"clientURL": "http://127.0.0.1:4002",
|
||||||
|
"name": "peer2",
|
||||||
|
"peerURL": "http://127.0.0.1:7002",
|
||||||
|
"state": "follower"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"clientURL": "http://127.0.0.1:4003",
|
||||||
|
"name": "peer3",
|
||||||
|
"peerURL": "http://127.0.0.1:7003",
|
||||||
|
"state": "follower"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Then take a closer look at the machine you want to remove.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -L http://127.0.0.1:7001/v2/admin/machines/peer2
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"clientURL": "http://127.0.0.1:4002",
|
||||||
|
"name": "peer2",
|
||||||
|
"peerURL": "http://127.0.0.1:7002",
|
||||||
|
"state": "follower"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
And finally remove it.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -L -XDELETE http://127.0.0.1:7001/v2/admin/machines/peer2
|
||||||
|
```
|
||||||
|
@ -33,6 +33,8 @@ function package {
|
|||||||
cp ${proj}/README.md ${target}/README-${proj}.md
|
cp ${proj}/README.md ${target}/README-${proj}.md
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mkdir release
|
||||||
|
cd release
|
||||||
|
|
||||||
for i in darwin windows linux; do
|
for i in darwin windows linux; do
|
||||||
export GOOS=${i}
|
export GOOS=${i}
|
||||||
|
@ -355,6 +355,7 @@ func (s *PeerServer) HTTPHandler() http.Handler {
|
|||||||
router.HandleFunc("/v2/admin/config", s.setClusterConfigHttpHandler).Methods("PUT")
|
router.HandleFunc("/v2/admin/config", s.setClusterConfigHttpHandler).Methods("PUT")
|
||||||
router.HandleFunc("/v2/admin/machines", s.getMachinesHttpHandler).Methods("GET")
|
router.HandleFunc("/v2/admin/machines", s.getMachinesHttpHandler).Methods("GET")
|
||||||
router.HandleFunc("/v2/admin/machines/{name}", s.getMachineHttpHandler).Methods("GET")
|
router.HandleFunc("/v2/admin/machines/{name}", s.getMachineHttpHandler).Methods("GET")
|
||||||
|
router.HandleFunc("/v2/admin/machines/{name}", s.RemoveHttpHandler).Methods("DELETE")
|
||||||
|
|
||||||
return router
|
return router
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
const ReleaseVersion = "0.4.0"
|
const ReleaseVersion = "0.4.1"
|
||||||
|
Reference in New Issue
Block a user