Skip to content

Commit

Permalink
Refactor port for metrics-addr 9990->8600
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Feb 19, 2019
1 parent 2809170 commit fd08649
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ func newStartCommand(ctx *cmdContext) *cobra.Command {
hostname, _ := os.Hostname()
f.StringVar(&conf.NodeID, "node-id", hostname, "Unique name for node. If not set, fallback to hostname")
f.BoolVarP(&conf.EnableProfiling, "profiling", "f", false, "Allow a pprof url (localhost:6060) for profiling purposes")
f.BoolVarP(&conf.EnableMetrics, "metrics", "m", false, "Allow export metrics through --metrics-addr (default localhost:9990)")
f.BoolVarP(&conf.EnableMetrics, "metrics", "m", false, "Allow export metrics through --metrics-addr (default localhost:8600)")
f.StringVar(&conf.PrivateKeyPath, "keypath", fmt.Sprintf("%s/%s", ctx.path, "id_ed25519"), "Server Singning private key file path")
f.StringVar(&conf.SSLCertificate, "certificate", fmt.Sprintf("%s/%s", ctx.path, "server.crt"), "Server crt file")
f.StringVar(&conf.SSLCertificateKey, "certificate-key", fmt.Sprintf("%s/%s", ctx.path, "server.key"), "Server key file")

f.StringVar(&conf.HTTPAddr, "http-addr", ":8800", "Endpoint for REST requests on (host:port)")
f.StringVar(&conf.RaftAddr, "raft-addr", ":9000", "Raft bind address (host:port)")
f.StringVar(&conf.MgmtAddr, "mgmt-addr", ":8700", "Management endpoint bind address (host:port)")
f.StringVar(&conf.MgmtAddr, "metrics-addr", ":9990", "Metrics export bind address (host:port)")
f.StringVar(&conf.MgmtAddr, "metrics-addr", ":8600", "Metrics export bind address (host:port)")
f.StringSliceVar(&conf.RaftJoinAddr, "join-addr", []string{}, "Raft: Comma-delimited list of nodes ([host]:port), through which a cluster can be joined")
f.StringVar(&conf.GossipAddr, "gossip-addr", ":9100", "Gossip: management endpoint bind address (host:port)")
f.StringSliceVar(&conf.GossipJoinAddr, "gossip-join-addr", []string{}, "Gossip: Comma-delimited list of nodes ([host]:port), through which a cluster can be joined")
Expand Down
2 changes: 1 addition & 1 deletion config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ server:
addr:
http: ":8800" # Endpoint for REST requests on (host:port).
mgmt: ":8700" # Management endpoint bind address (host:port).
metrics: ":9990" # Metrics endpoint (host:port). where raft node can join the current cluster
metrics: ":8600" # Metrics endpoint (host:port). where raft node can join the current cluster
raft: ":9000" # Raft bind address (host:port). internal message passing
raft_join: # Raft: list of nodes ([host]:port), where the node can join the cluster using the mgmt endpoint
- "127.0.0.1:8700"
Expand Down
6 changes: 3 additions & 3 deletions deploy/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,22 @@ module "prometheus" {
- job_name: 'Qed-00-Service'
scrape_interval: 10s
static_configs:
- targets: ['${module.leader.private_ip}:9990']
- targets: ['${module.leader.private_ip}:8600']
- job_name: 'Qed-01-Host'
scrape_interval: 10s
static_configs:
- targets: ['${module.follower-1.private_ip}:9100']
- job_name: 'Qed-01-Service'
scrape_interval: 10s
static_configs:
- targets: ['${module.follower-1.private_ip}:9990']
- targets: ['${module.follower-1.private_ip}:8600']
- job_name: 'Qed-02-Host'
scrape_interval: 10s
static_configs:
- targets: ['${module.follower-2.private_ip}:9100']
- job_name: 'Qed-02-Service'
scrape_interval: 10s
static_configs:
- targets: ['${module.follower-2.private_ip}:9990']
- targets: ['${module.follower-2.private_ip}:8600']
CONFIG
}
2 changes: 1 addition & 1 deletion server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func DefaultConfig() *Config {
HTTPAddr: "127.0.0.1:8800",
RaftAddr: "127.0.0.1:9000",
MgmtAddr: "127.0.0.1:8700",
MetricsAddr: "127.0.0.1:9990",
MetricsAddr: "127.0.0.1:8600",
RaftJoinAddr: []string{},
GossipAddr: "127.0.0.1:9100",
GossipJoinAddr: []string{},
Expand Down
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (s *Server) Start() error {

if s.conf.EnableMetrics {
go func() {
log.Debugf(" * Starting metrics HTTP server in addr: localhost:9990")
log.Debugf(" * Starting metrics HTTP server in addr: %s", s.conf.MetricsAddr)
if err := s.metricsServer.ListenAndServe(); err != http.ErrServerClosed {
log.Errorf("Can't start metrics HTTP server: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

const (
QEDProfilingURL = "http://localhost:6060/debug/pprof"
QEDMetricsURL = "http://localhost:9990/metrics"
QEDMetricsURL = "http://localhost:8600/metrics"
)

// FIXME: This function should also include testing for the other servers, not
Expand Down

0 comments on commit fd08649

Please sign in to comment.