Close #195. Allow configuring bind address
parent
5c1fc6a36c
commit
50942ef746
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -165,7 +165,7 @@
|
||||||
- [Issue #184](https://github.com/influxdb/influxdb/issues/184). Implement Raft log compaction.
|
- [Issue #184](https://github.com/influxdb/influxdb/issues/184). Implement Raft log compaction.
|
||||||
- [Issue #153](https://github.com/influxdb/influxdb/issues/153). Implement continuous queries
|
- [Issue #153](https://github.com/influxdb/influxdb/issues/153). Implement continuous queries
|
||||||
|
|
||||||
## Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
- [Issue #90](https://github.com/influxdb/influxdb/issues/90). Group by multiple columns panic
|
- [Issue #90](https://github.com/influxdb/influxdb/issues/90). Group by multiple columns panic
|
||||||
- [Issue #89](https://github.com/influxdb/influxdb/issues/89). 'Group by' combined with 'where' not working
|
- [Issue #89](https://github.com/influxdb/influxdb/issues/89). 'Group by' combined with 'where' not working
|
||||||
|
@ -192,3 +192,11 @@
|
||||||
- deprecate endpoints `/db/:db/admins/:user` in favor of using `/db/:db/users/:user` which should
|
- deprecate endpoints `/db/:db/admins/:user` in favor of using `/db/:db/users/:user` which should
|
||||||
be used to update user flags, password, etc.
|
be used to update user flags, password, etc.
|
||||||
- Querying for column names that don't exist no longer throws an error.
|
- Querying for column names that don't exist no longer throws an error.
|
||||||
|
|
||||||
|
## v0.5.0 [unreleased]
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
- [Issue #195](https://github.com/influxdb/influxdb/issues/195). Allow the bind address to be configurable, Thanks @schmurfy.
|
||||||
|
|
||||||
|
### Deprecated
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
# that can be resovled here.
|
# that can be resovled here.
|
||||||
# hostname = ""
|
# hostname = ""
|
||||||
|
|
||||||
|
bind-address = "0.0.0.0"
|
||||||
|
|
||||||
[logging]
|
[logging]
|
||||||
# logging level can be one of "debug", "info", "warn" or "error"
|
# logging level can be one of "debug", "info", "warn" or "error"
|
||||||
level = "info"
|
level = "info"
|
||||||
|
|
|
@ -45,6 +45,7 @@ type TomlConfiguration struct {
|
||||||
Cluster ClusterConfig
|
Cluster ClusterConfig
|
||||||
Logging LoggingConfig
|
Logging LoggingConfig
|
||||||
Hostname string
|
Hostname string
|
||||||
|
BindAddress string `toml:"bind-address"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Configuration struct {
|
type Configuration struct {
|
||||||
|
@ -59,6 +60,7 @@ type Configuration struct {
|
||||||
Hostname string
|
Hostname string
|
||||||
LogFile string
|
LogFile string
|
||||||
LogLevel string
|
LogLevel string
|
||||||
|
BindAddress string
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadConfiguration(fileName string) *Configuration {
|
func LoadConfiguration(fileName string) *Configuration {
|
||||||
|
@ -93,6 +95,7 @@ func parseTomlConfiguration(filename string) (*Configuration, error) {
|
||||||
LogFile: tomlConfiguration.Logging.File,
|
LogFile: tomlConfiguration.Logging.File,
|
||||||
LogLevel: tomlConfiguration.Logging.Level,
|
LogLevel: tomlConfiguration.Logging.Level,
|
||||||
Hostname: tomlConfiguration.Hostname,
|
Hostname: tomlConfiguration.Hostname,
|
||||||
|
BindAddress: tomlConfiguration.BindAddress,
|
||||||
}
|
}
|
||||||
|
|
||||||
return config, nil
|
return config, nil
|
||||||
|
@ -117,15 +120,15 @@ func parseJsonConfiguration(fileName string) (*Configuration, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Configuration) AdminHttpPortString() string {
|
func (self *Configuration) AdminHttpPortString() string {
|
||||||
return fmt.Sprintf(":%d", self.AdminHttpPort)
|
return fmt.Sprintf("%s:%d", self.BindAddress, self.AdminHttpPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Configuration) ApiHttpPortString() string {
|
func (self *Configuration) ApiHttpPortString() string {
|
||||||
return fmt.Sprintf(":%d", self.ApiHttpPort)
|
return fmt.Sprintf("%s:%d", self.BindAddress, self.ApiHttpPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Configuration) ProtobufPortString() string {
|
func (self *Configuration) ProtobufPortString() string {
|
||||||
return fmt.Sprintf(":%d", self.ProtobufPort)
|
return fmt.Sprintf("%s:%d", self.BindAddress, self.ProtobufPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Configuration) HostnameOrDetect() string {
|
func (self *Configuration) HostnameOrDetect() string {
|
||||||
|
|
|
@ -35,6 +35,7 @@ type RaftServer struct {
|
||||||
host string
|
host string
|
||||||
port int
|
port int
|
||||||
path string
|
path string
|
||||||
|
bind_address string
|
||||||
router *mux.Router
|
router *mux.Router
|
||||||
raftServer raft.Server
|
raftServer raft.Server
|
||||||
httpServer *http.Server
|
httpServer *http.Server
|
||||||
|
@ -69,6 +70,7 @@ func NewRaftServer(config *configuration.Configuration, clusterConfig *ClusterCo
|
||||||
host: config.HostnameOrDetect(),
|
host: config.HostnameOrDetect(),
|
||||||
port: config.RaftServerPort,
|
port: config.RaftServerPort,
|
||||||
path: config.RaftDir,
|
path: config.RaftDir,
|
||||||
|
bind_address: config.BindAddress,
|
||||||
clusterConfig: clusterConfig,
|
clusterConfig: clusterConfig,
|
||||||
notLeader: make(chan bool, 1),
|
notLeader: make(chan bool, 1),
|
||||||
router: mux.NewRouter(),
|
router: mux.NewRouter(),
|
||||||
|
@ -449,7 +451,7 @@ func (s *RaftServer) runContinuousQuery(db string, query *parser.SelectQuery, st
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *RaftServer) ListenAndServe() error {
|
func (s *RaftServer) ListenAndServe() error {
|
||||||
l, err := net.Listen("tcp", fmt.Sprintf(":%d", s.port))
|
l, err := net.Listen("tcp", fmt.Sprintf("%s:%d", s.bind_address, s.port))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,8 +130,12 @@ func main() {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Starting Influx Server...")
|
if config.BindAddress == "" {
|
||||||
|
log.Info("Starting Influx Server...")
|
||||||
|
} else {
|
||||||
|
log.Info("Starting Influx Server bound to %s ...", config.BindAddress)
|
||||||
|
}
|
||||||
log.Info(`
|
log.Info(`
|
||||||
+---------------------------------------------+
|
+---------------------------------------------+
|
||||||
| _____ __ _ _____ ____ |
|
| _____ __ _ _____ ____ |
|
||||||
|
|
Loading…
Reference in New Issue