nginx를 통한 로드밸런싱 구성
Last updated
Last updated
nohup docker run -p 8080:80 uesrname/spring-boot-cpu-bound > nohup.out 2>&1 &tail: nohup.out: file truncated
/usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint ni
fty_albattani (9caf4a3e7742ebf9682e1847cb1d79868ef12cba0f6727ffe9bcb024380e8797): Bind for 0.0.0.0:8080 failed: por
t is already allocated.[username@cpu-worker-instance-2 ~]$ tail -f nohup.out
/usr/bin/docker-current: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running?.
See '/usr/bin/docker-current run --help'.sudo systemctl start docker
sudo chmod 666 /var/run/docker.socksudo yum install nginxsudo systemctl start nginxsudo vi /etc/nginx/nginx.confupstream cpu-bound-app {
server {instance_1번의_ip}:8080 weight=100 max_fails=3 fail_timeout=3s;
server {instance_2번의_ip}:8080 weight=100 max_fails=3 fail_timeout=3s;
server {instance_3번의_ip}:8080 weight=100 max_fails=3 fail_timeout=3s;
}location / {
proxy_pass http://cpu-bound-app;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}http://{nginx ip}/hash/123sudo systemctl reload nginxsudo tail -f /var/log/nginx/error.logconnect() to 10.178.0.6:8080 failed (13: Permission denied) while connect
ing to upstream, client: 124.111.12.53, server: _, request: "GET /hash/123 HTTP/1.1", upstream: "http://10.178.0.6:
8080/hash/123", host: "35.221.162.185"sudo setsebool -P httpd_can_network_connect on