sregister

command module
v0.0.0-...-d547b82 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2015 License: MIT Imports: 2 Imported by: 0

README

sregister

Build Status

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.

Installation

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 &

Configuration

The default application configuration file of SRegister is at /etc/sfinder/sregister/sregister.conf

  • SREG_LOG_DIR: log directory of sregister
  • SREG_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.
Services Configuration

The configuration follow the nerve. The configuration contains the following options:

  • name: the name of the service
  • host: the default host on which to make service checks; you should make this your public ip to ensure your service is publically accessible
  • port: the default port for service checks; nerve will report the host:port combo via your chosen reporter
  • reporterType: the mechanism used to report up/down information; depending on the reporter you choose, additional parameters may be required. Defaults to etcd
  • checkInterval: the frequency with which service checks will be initiated; defaults to 2s
  • 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

TODO

1. add http service watcher 2. add mysql service watcher 3. add docker servcie watcher 4. support Zookeeper

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/coreos/etcd/client
Package client provides bindings for the etcd APIs.
Package client provides bindings for the etcd APIs.
_workspace/src/github.com/golang/glog
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
_workspace/src/github.com/ugorji/go/codec
High Performance, Feature-Rich Idiomatic Go codec/encoding library for binc, msgpack, cbor, json.
High Performance, Feature-Rich Idiomatic Go codec/encoding library for binc, msgpack, cbor, json.
_workspace/src/github.com/ugorji/go/codec/codecgen
codecgen generates codec.Selfer implementations for a set of types.
codecgen generates codec.Selfer implementations for a set of types.
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
_workspace/src/golang.org/x/net/context/ctxhttp
Package ctxhttp provides helper functions for performing context-aware HTTP requests.
Package ctxhttp provides helper functions for performing context-aware HTTP requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL