diff --git a/consul/state_store.go b/consul/state_store.go index 84cc600af4..8284b5c5c5 100644 --- a/consul/state_store.go +++ b/consul/state_store.go @@ -83,7 +83,7 @@ func (s *StateStore) Close() error { // initialize is used to setup the store for use func (s *StateStore) initialize() error { // Setup the Env first - if err := s.env.SetMaxDBs(mdb.DBI(16)); err != nil { + if err := s.env.SetMaxDBs(mdb.DBI(32)); err != nil { return err } diff --git a/consul/util.go b/consul/util.go index b1ca085c63..826010547b 100644 --- a/consul/util.go +++ b/consul/util.go @@ -1,6 +1,7 @@ package consul import ( + "encoding/binary" "fmt" "github.com/hashicorp/serf/serf" "net" @@ -112,3 +113,15 @@ func GetPrivateIP() (*net.IPNet, error) { } return nil, fmt.Errorf("No private IP address found") } + +// Converts bytes to an integer +func bytesToUint64(b []byte) uint64 { + return binary.BigEndian.Uint64(b) +} + +// Converts a uint to a byte slice +func uint64ToBytes(u uint64) []byte { + buf := make([]byte, 8) + binary.BigEndian.PutUint64(buf, u) + return buf +}