Load balancing with NGINX
core-01
$ fleetctl list-units
UNIT MACHINE ACTIVE SUB
[email protected] 3408f7ab.../172.17.8.103 active running
[email protected] b2ca4512.../172.17.8.101 active running
[email protected] 3408f7ab.../172.17.8.103 active running
[email protected] b2ca4512.../172.17.8.101 active running
[email protected] 3408f7ab.../172.17.8.103 active running
[email protected] db577263.../172.17.8.102 active running
[email protected] b2ca4512.../172.17.8.101 active running
[email protected] 3408f7ab.../172.17.8.103 active running
[email protected] db577263.../172.17.8.102 active running
[email protected] b2ca4512.../172.17.8.101 active running
Я заменил оригинальные image, своими. Они отличаются пока только IP адресом. С оригинальным у меня не заработало.
$ vi nginx.service
$ fleetctl submit nginx.service
$ fleetctl start nginx.service
$ fleetctl list-units
UNIT MACHINE ACTIVE SUB
nginx.service 3408f7ab.../172.17.8.103 active running
nginx.service b2ca4512.../172.17.8.101 active running
nginx.service db577263.../172.17.8.102 active running
[email protected] 3408f7ab.../172.17.8.103 active running
[email protected] b2ca4512.../172.17.8.101 active running
[email protected] 3408f7ab.../172.17.8.103 active running
[email protected] b2ca4512.../172.17.8.101 active running
[email protected] 3408f7ab.../172.17.8.103 active running
[email protected] db577263.../172.17.8.102 active running
[email protected] b2ca4512.../172.17.8.101 active running
[email protected] 3408f7ab.../172.17.8.103 active running
[email protected] db577263.../172.17.8.102 active running
[email protected] b2ca4512.../172.17.8.101 active running
// логи
$ journalctl -f --lines -u nginx
http://172.17.8.101/
http://172.17.8.102/
http://172.17.8.103/
Тоже самое, только на 80 порту а не на 3000
Если нужно остановить и выгрузить все, что касается сервиса:
$ fleetctl stop nginx.service
$ fleetctl unload nginx.service
$ fleetctl destroy nginx.service