Add hostname to configuration

pull/144/head
Paul Dix 2013-12-13 10:23:57 -05:00
parent 8421316374
commit 8b3b1d42ca
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,10 @@
# Welcome to the InfluxDB configuration file.
# If hostname (on the OS) doesn't return a name that can be resolved by the other
# systems in the cluster, you'll have to set the hostname to an IP or something
# that can be resovled here.
# hostname = ""
[logging]
# logging level can be one of "debug", "info", "warn" or "error"
# level = "info"

View File

@ -46,6 +46,7 @@ func parseTomlConfiguration(filename string) (*Configuration, error) {
protobufPort := configSet.Int("cluster.protobuf_port", 8099)
logFile := configSet.String("logging.file", "influxdb.log")
logLevel := configSet.String("logging.level", "info")
hostname := configSet.String("hostname", "")
if err := configSet.Parse(filename); err != nil {
return nil, err
@ -61,6 +62,7 @@ func parseTomlConfiguration(filename string) (*Configuration, error) {
DataDir: *dataDir,
LogFile: *logFile,
LogLevel: *logLevel,
Hostname: *hostname,
}
servers := strings.Split(*seedServers, ",")