Fixed node balancer service file and deploy

pull/507/head
kompotkot 2021-12-22 10:55:08 +00:00
rodzic 6a02719225
commit b34eb909a2
3 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -46,6 +46,11 @@ echo
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}"
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 -e "${PREFIX_INFO} Building executable load balancer for nodes script with Go"

Wyświetl plik

@ -11,7 +11,7 @@ WorkingDirectory=/home/ubuntu/moonstream/nodes/node_balancer
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
Restart=on-failure
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
[Install]

Wyświetl plik

@ -152,7 +152,7 @@ func InitServer() {
serveMux := http.NewServeMux()
serveMux.HandleFunc("/ping", pingRoute)
serveMux.HandleFunc("/lb/", lbHandler)
serveMux.HandleFunc("/nb/", lbHandler)
// Set common middlewares, from bottom to top
commonHandler := logMiddleware(serveMux)