Skip to content

Commit

Permalink
add failover support by zookeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
Terry-Mao committed Dec 12, 2014
1 parent 722bd58 commit ec3a192
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 187 deletions.
16 changes: 0 additions & 16 deletions client/client.go

This file was deleted.

2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Config struct {
Log string `goconf:"base:log"`
MaxProc int `goconf:"base:maxproc"`
RPCBind []string `goconf:"base:rpc.bind:,"`
ThriftBind []string `goconf:"base:thrift.bind:,"`
StatBind []string `goconf:"base:stat.bind:,"`
PprofBind []string `goconf:"base:pprof.bind:,"`
DatacenterId int64 `goconf:"snowflake:datacenter"`
Expand All @@ -57,6 +58,7 @@ func InitConfig() (err error) {
Log: "./log/xml",
MaxProc: runtime.NumCPU(),
RPCBind: []string{"localhost:8080"},
ThriftBind: []string{"localhost:8081"},
DatacenterId: 0,
WorkerId: []int64{0},
ZKAddr: []string{"localhost:2181"},
Expand Down
Binary file modified gosnowflake
Binary file not shown.
12 changes: 12 additions & 0 deletions gosnowflake-example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ pid /tmp/gosnowflake.pid
# rpc.bind 127.0.0.1:8080
# rpc.bind :8080

# By default gosnowflake thrift listens for connections from all the network interfaces
# available on the server on 8080 port. It is possible to listen to just one or
# multiple interfaces using the "rpc.bind" configuration directive,
# followed by one or more IP addresses and port.
#
# Examples:
#
# Note this directive is only support "thrift" protocol
# thrift.bind 192.168.1.100:8080,10.0.0.1:8080
# thrift.bind 127.0.0.1:8080
# thrift.bind :8080

# This is used by gosnowflake service profiling (pprof).
# By default gosnowflake pprof listens for connections from local interfaces on 6971
# port. It's not safty for listening internet IP addresses.
Expand Down
108 changes: 0 additions & 108 deletions gosnowflake.conf

This file was deleted.

Loading

0 comments on commit ec3a192

Please sign in to comment.