Fix admin configuration.

pull/1565/head
Todd Persen 2015-02-10 23:34:17 -08:00
parent 8bb95cb151
commit 286c9a9635
4 changed files with 7 additions and 8 deletions

View File

@ -59,7 +59,6 @@ type Config struct {
Admin struct {
Port int `toml:"port"`
Assets string `toml:"assets"`
} `toml:"admin"`
HTTPAPI struct {

View File

@ -56,8 +56,6 @@ func TestParseConfig(t *testing.T) {
if c.Admin.Port != 8083 {
t.Fatalf("admin port mismatch: %v", c.Admin.Port)
} else if c.Admin.Assets != "./admin" {
t.Fatalf("admin assets mismatch: %v", c.Admin.Assets)
}
if c.Data.Port != main.DefaultBrokerPort {

View File

@ -71,10 +71,12 @@ func Run(config *Config, join, version string, logWriter *os.File) (*messaging.B
}
log.Printf("data node #%d listening on %s", s.ID(), config.DataAddr())
// Start the admin interface on the default port
log.Printf("starting admin server on :8083")
a := admin.NewHttpServer(":8083")
go a.ListenAndServe()
// Start the admin interface on the default port
if config.Admin.Port > 0 {
log.Printf("starting admin server on :8083")
a := admin.NewHttpServer(":8083")
go a.ListenAndServe()
}
// Spin up the collectd server
if config.Collectd.Enabled {

View File

@ -34,7 +34,7 @@ port = 8083 # binding is disabled if the port isn't set
# Configure the HTTP API endpoint. All time-series data and queries uses this endpoint.
[api]
# ssl-port = 8084 # SSL support is enabled if you set a port and cert
# ssl-port = 8087 # SSL support is enabled if you set a port and cert
# ssl-cert = "/path/to/cert.pem"
# Configure the Graphite plugins.