SRegisater is a service register component of a service-discovery framework SFinder which actully is another wheel similar with Smartstack, SRegister is analagous to nerve.
it monitor the service and report to ETCD with the address and port of the service.
Please make sure your go version is beyong 1.5
Get the source code using the command:
$ go get github.com/norlanliu/sregister
go to the sregister directory
$ cd src/github.com/norlanliu/sregisater
make the source code
$ make
install
$ sudo make install
Then, start sregister
1.Redhat/Centos/Fedora start the sregister with systemctl
$ systemctl enable sregister; systemctl start sregister
$ systemctl status sregister
2.Debain/Ubuntu
$ sregister -h # get the help
$ sudo sregister &
The default application configuration file of SRegister is at /etc/sfinder/sregister/sregister.conf
SREG_LOG_DIR
: log directory of sregisterSREG_SERVICES_DIR
: path to a directory in which each json file whill be interpreted as a service, you can add/delete/modify the service file at any time without stop the sregister.
The configuration follow the nerve. The configuration contains the following options:
name
: the name of the servicehost
: the default host on which to make service checks; you should make this your public ip to ensure your service is publically accessibleport
: the default port for service checks; nerve will report thehost
:port
combo via your chosen reporterreporterType
: the mechanism used to report up/down information; depending on the reporter you choose, additional parameters may be required. Defaults toetcd
checkInterval
: the frequency with which service checks will be initiated; defaults to2s
weight
: a positive integer weight value which can be used to affect the haproxy backend weighting in sdiscovery.checks
: a list of checks that nerve will perform; if all of the pass, the service will be registered; otherwise, it will be un-registered
1. add http service watcher
2. add mysql service watcher
3. add docker servcie watcher
4. support Zookeeper