项目作者: petrovicboban

项目描述 :
Framework for service availability via zookeeper
高级语言: Go
项目地址: git://github.com/petrovicboban/go-keepAlive.git
创建时间: 2017-11-06T15:12:30Z
项目社区:https://github.com/petrovicboban/go-keepAlive

开源协议:GNU General Public License v3.0

下载


go-keepAlive

go-keepAlive is HA tool witch checks services health on multiple services nodes and updates zookeeper node defined for specific service with healthy services nodes.

Quick start

  • create app configuration file, config.yml, like bellow:
    ```

services:

  1. - name: test_service
  2. nodes:
  3. - ip: 172.217.16.99
  4. port: 80
  5. - ip: 172.217.16.110
  6. port: 80
  1. - start app in bootstrap mode:
  2. `go_keepAlive -bootstrap`
  3. App connects to zookeeper(s) defined with `-zk` flag or localhost by default, and creates zk nodes structure as defined in configuration file.
  4. - start app node on multiple servers:
  5. `go_keepalive`
  6. App does not need configuration, it reads it from zookeeper. Also, it auto detects if it should start in master or agent mode: if there is no master, it will start in master mode; otherwise, it will start in agent mode.
  7. It also requires `-zk` flag if zookeeper is not on localhost.
  8. - read contents of service node, representing healthy nodes:

[zk: localhost:2181(CONNECTED) 17] get /go-keepAlive/services/test_service
172.217.16.99 172.217.16.110
cZxid = 0xf3d6
ctime = Tue Nov 07 15:31:52 UTC 2017
mZxid = 0xf3eb
mtime = Thu Nov 09 11:12:00 UTC 2017
pZxid = 0xf3d9
cversion = 2
dataVersion = 2
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 28
numChildren = 2
```

Notes

The project is still in early alpha release, lacking a lot of features, and with potential bugs.