kopia lustrzana https://github.com/bugout-dev/moonstream
Fixed node balancer service file and deploy
rodzic
6a02719225
commit
b34eb909a2
|
@ -46,6 +46,11 @@ echo
|
||||||
echo -e "${PREFIX_INFO} Retrieving addition deployment parameters"
|
echo -e "${PREFIX_INFO} Retrieving addition deployment parameters"
|
||||||
HOME=/root AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" $HOME/go/bin/checkenv show aws_ssm+Product:moonstream >> "${PARAMETERS_ENV_PATH}"
|
HOME=/root AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" $HOME/go/bin/checkenv show aws_ssm+Product:moonstream >> "${PARAMETERS_ENV_PATH}"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo
|
||||||
|
echo -e "${PREFIX_INFO} Add instance local IP to parameters"
|
||||||
|
echo "AWS_LOCAL_IPV4=$(ec2metadata --local-ipv4)" >> "${PARAMETERS_ENV_PATH}"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo -e "${PREFIX_INFO} Building executable load balancer for nodes script with Go"
|
echo -e "${PREFIX_INFO} Building executable load balancer for nodes script with Go"
|
||||||
|
|
|
@ -11,7 +11,7 @@ WorkingDirectory=/home/ubuntu/moonstream/nodes/node_balancer
|
||||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=15s
|
RestartSec=15s
|
||||||
ExecStart=/home/ubuntu/moonstream/nodes/node_balancer/nodebalancer -host "$(ec2metadata --local-ipv4)" -port 8544 -healthcheck
|
ExecStart=/home/ubuntu/moonstream/nodes/node_balancer/nodebalancer -host "${AWS_LOCAL_IPV4}" -port 8544 -healthcheck
|
||||||
SyslogIdentifier=node-balancer
|
SyslogIdentifier=node-balancer
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
@ -152,7 +152,7 @@ func InitServer() {
|
||||||
|
|
||||||
serveMux := http.NewServeMux()
|
serveMux := http.NewServeMux()
|
||||||
serveMux.HandleFunc("/ping", pingRoute)
|
serveMux.HandleFunc("/ping", pingRoute)
|
||||||
serveMux.HandleFunc("/lb/", lbHandler)
|
serveMux.HandleFunc("/nb/", lbHandler)
|
||||||
|
|
||||||
// Set common middlewares, from bottom to top
|
// Set common middlewares, from bottom to top
|
||||||
commonHandler := logMiddleware(serveMux)
|
commonHandler := logMiddleware(serveMux)
|
||||||
|
|
Ładowanie…
Reference in New Issue