trouble shooting - Genie-Uss/genieus GitHub Wiki
API Gateway๊ฐ Eureka ์๋ฒ์ ์ฑ๊ณต์ ์ผ๋ก ์ฐ๊ฒฐ๋์์ผ๋ ์๋น์ค ํธ์ถ ์ ๋คํธ์ํฌ ์ฐ๊ฒฐ ์ค๋ฅ ๋ฐ์ํจ.
io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: null: /172.18.0.8:10000
Caused by: java.net.NoRouteToHostException: null
flowchart TB
%% ์ฌ์ฉ์
User(["์ฌ์ฉ์"])
%% ํผ๋ธ๋ฆญ VPC
subgraph PublicVPC["ํผ๋ธ๋ฆญ VPC"]
API_Gateway["[ํผ๋ธ๋ฆญ EC2] API Gateway"]
end
%% ํ๋ผ์ด๋น VPC
subgraph PrivateVPC["ํ๋ผ์ด๋น VPC"]
subgraph DockerNetwork["Docker ๋คํธ์ํฌ"]
Eureka["Eureka Server(์๋น์ค ๋์ค์ปค๋ฒ๋ฆฌ)"]
AuthService["AUTH-SERVICE [172.18.0.8:10000]"]
OtherService1["USER-SERVICE"]
OtherService2["PRODUCT-SERVICE"]
OtherService3["๊ธฐํ ์๋น์ค"]
%% ๋ด๋ถ Docker ๋คํธ์ํฌ์์์ ์ฐ๊ฒฐ
Eureka --- AuthService
Eureka --- OtherService1
Eureka --- OtherService2
Eureka --- OtherService3
end
end
%% ์ฐ๊ฒฐ ๊ด๊ณ
User -->|"HTTP ์์ฒญ"| API_Gateway
API_Gateway -->|"์๋น์ค ๋์ค์ปค๋ฒ๋ฆฌ ์ฑ๊ณต"| Eureka
API_Gateway -.->|"์๋น์ค ํธ์ถ ์คํจ (NoRouteToHostException)"| AuthService
%% ์คํ์ผ ์ค์
classDef publicService fill:#ffcc99,stroke:#ff9933,stroke-width:2px
classDef privateService fill:#99ccff,stroke:#3366cc,stroke-width:2px
class API_Gateway publicService
class Eureka,AuthService,OtherService1,OtherService2,OtherService3 privateService
linkStyle 5 stroke:#009900,stroke-width:2px,color:#009900
linkStyle 6 stroke:#ff0000,stroke-width:2px,stroke-dasharray:5 5,color:#ff0000
- API Gateway๋ Eureka์์
AUTH-SERVICE
๋ฅผ ์ฐพ์์ผ๋(172.18.0.8:10000) ์ค์ ๋คํธ์ํฌ ๊ฒฝ๋ก ์์ - API Gateway: ํผ๋ธ๋ฆญ ์ธ์คํด์ค(EC2)์ ๋ฐฐํฌ๋จ
- ์ ๋ ์นด ์๋ฒ + ๋ง์ดํฌ๋ก์๋น์ค๋ค: ํ๋ผ์ด๋น ์ธ์คํด์ค(EC2) ๋ด๋ถ์ Docker ๋คํธ์ํฌ์ ๋ฐฐํฌ๋จ
- Gateway๊ฐ ์๋น์ค ํธ์ถ ์ ์ฌ์ฉํ๋ IP(172.18.0.8)๋ ํ๋ผ์ด๋น Docker ๋คํธ์ํฌ ๋ด๋ถ ์ฃผ์๋ผ ํผ๋ธ๋ฆญ ์ธ์คํด์ค์์ ์ง์ ์ ๊ทผ ๋ถ๊ฐ๋ฅํจ
-
AWS Transit Gateway/VPC Peering ์ฌ์ฉ:
- ํผ๋ธ๋ฆญ VPC์ ํ๋ผ์ด๋น VPC ๊ฐ ํผ์ด๋ง์ผ๋ก ์ง์ ํต์ ๊ฐ๋ฅํ๊ฒ ํจ
- ๋ณต์กํ ๋คํธ์ํฌ ์ค์ ํ์ํจ
-
๋ก๋ ๋ฐธ๋ฐ์ ์ฌ์ฉ:
- ํ๋ผ์ด๋น ์ธ์คํด์ค์ ์๋น์ค๋ค ์์ ๋ด๋ถ ๋ก๋ ๋ฐธ๋ฐ์ ๋ฐฐ์น
- API Gateway๊ฐ ๋ก๋ ๋ฐธ๋ฐ์ ํตํด ์๋น์ค ์ ๊ทผํ๋๋ก ํจ
- ์ถ๊ฐ ๋น์ฉ ๋ฐ์ํจ
-
๋ฆฌ๋ฒ์ค ํ๋ก์ ์ค์ :
- ํ๋ผ์ด๋น ์ธ์คํด์ค์ NGINX ๊ฐ์ ๋ฆฌ๋ฒ์ค ํ๋ก์ ์ค์น
- ํผ๋ธ๋ฆญ API Gateway๊ฐ ํ๋ก์ ํตํด ๋ง์ดํฌ๋ก์๋น์ค ์ ๊ทผํ๋๋ก ํจ
- ๊ตฌ์ฑ์ด ๋น๊ต์ ๊ฐ๋จํจ
-
์๋น์ค ๋ฉ์ ๋์
:
- Istio ๊ฐ์ ์๋น์ค ๋ฉ์๋ก ๋คํธ์ํฌ ํต์ ๊ด๋ฆฌ
- ๋ฌ๋ ์ปค๋ธ์ ์ค๋ฒํค๋ ๋ฐ์ํจ
API Gateway๋ ๋ด๋ถ ๋คํธ์ํฌ์ ๋๊ณ NGINX๋ง ํ๋ก์๋ก ํผ๋ธ๋ฆญ ์ธ์คํด์ค์ ๋ฐฐ์นํจ.
[์ธ๋ถ ์์ฒญ] โ [NGINX ํ๋ก์(ํผ๋ธ๋ฆญ)] โ [API Gateway(ํ๋ผ์ด๋น)] โ [๋ง์ดํฌ๋ก์๋น์ค(ํ๋ผ์ด๋น)]
flowchart TB
%% ์ฌ์ฉ์
User(["์ฌ์ฉ์"])
%% ํผ๋ธ๋ฆญ VPC
subgraph PublicVPC["ํผ๋ธ๋ฆญ VPC"]
NGINX["[ํผ๋ธ๋ฆญ EC2] Nginx ํ๋ก์"]
end
%% ํ๋ผ์ด๋น VPC
subgraph PrivateVPC["ํ๋ผ์ด๋น VPC"]
subgraph DockerNetwork["Docker ๋คํธ์ํฌ"]
API_Gateway["API Gateway"]
Eureka["Eureka Server\n(์๋น์ค ๋์ค์ปค๋ฒ๋ฆฌ)"]
AuthService["AUTH-SERVICE"]
UserService["USER-SERVICE"]
ProductService["PRODUCT-SERVICE"]
end
%% ๋ด๋ถ ์๋น์ค ๊ฐ ์ฐ๊ฒฐ
Eureka --- AuthService
Eureka --- UserService
Eureka --- ProductService
end
%% ์ธ๋ถ ์์ฒญ ํ๋ฆ
User -->|"HTTP ์์ฒญ"| NGINX
NGINX -->|"์ญ๋ฐฉํฅ ํ๋ก์"| API_Gateway
API_Gateway -->|"์๋น์ค ๋์ค์ปค๋ฒ๋ฆฌ"| Eureka
API_Gateway -->|"์๋น์ค ํธ์ถ"| AuthService
%% ์คํ์ผ ์ ์
classDef publicService fill:#ffcc99,stroke:#ff9933,stroke-width:2px
classDef privateService fill:#99ccff,stroke:#3366cc,stroke-width:2px
classDef edgeStyle stroke-width:2px
class NGINX publicService
class API_Gateway,Eureka,AuthService,UserService,ProductService privateService
-
์ํคํ ์ฒ ๋จ์ํ
: ๋ชจ๋ ๋ง์ดํฌ๋ก์๋น์ค์ API Gateway๊ฐ ๊ฐ์ Docker ๋คํธ์ํฌ ๋ด์์ ์ง์ ํต์ ๊ฐ๋ฅํจ -
๋ณด์ ํฅ์
: API Gateway๊ฐ ๋ด๋ถ์ ์์ด ์ธ๋ถ ๊ณต๊ฒฉ์ ์ง์ ๋ ธ์ถ๋์ง ์์ -
๋คํธ์ํฌ ์ง์ฐ ๊ฐ์
: ๊ฐ์ ๋คํธ์ํฌ ๋ด ํต์ ์ผ๋ก ์ง์ฐ ๊ฐ์ํจ -
Eureka ์๋น์ค ๋ฐ๊ฒฌ ๊ฐ์ํ
: Docker ๋ด๋ถ IP๋ฅผ ๋ณํ ์์ด ๊ทธ๋๋ก ์ฌ์ฉ ๊ฐ๋ฅํจ -
์ค์ ๋จ์ํ
: ๋ณต์กํ ๋คํธ์ํฌ ์ค์ ์ด๋ VPC ํผ์ด๋ง ๋ถํ์ํจ
server {
listen 80;
server_name domain.com;
location / {
proxy_pass http://api-gateway:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
...
}
}
flowchart TB
%% ์ฌ์ฉ์
User(["์ฌ์ฉ์"])
%% ํผ๋ธ๋ฆญ VPC
subgraph PublicVPC["ํผ๋ธ๋ฆญ VPC"]
NGINX["[ํผ๋ธ๋ฆญ EC2] NGINX ํ๋ก์"]
end
%% ํ๋ผ์ด๋น VPC
subgraph PrivateVPC["ํ๋ผ์ด๋น VPC"]
subgraph DockerNetwork["Docker ๋คํธ์ํฌ"]
API_Gateway["API Gateway"]
Eureka["Eureka Server\n(์๋น์ค ๋์ค์ปค๋ฒ๋ฆฌ)"]
AuthService["AUTH-SERVICE"]
UserService["USER-SERVICE"]
ProductService["PRODUCT-SERVICE"]
%% ๋ชจ๋ํฐ๋ง ๋ฐ ๊ฐ๋ฐ ๋๊ตฌ
Grafana["Grafana"]
KafkaUI["Kafka UI"]
end
%% ๋ด๋ถ ์๋น์ค ๊ฐ ์ฐ๊ฒฐ
Eureka --- AuthService
Eureka --- UserService
Eureka --- ProductService
end
%% ์ธ๋ถ ์์ฒญ ํ๋ฆ
User -->|"HTTP ์์ฒญ"| NGINX
%% ํ๋ก์ ๊ฒฝ๋ก๋ณ ์ฐ๊ฒฐ
NGINX -->|"ํ๋ก์: /api"| API_Gateway
NGINX -->|"ํ๋ก์: /grafana"| Grafana
NGINX -->|"ํ๋ก์: /kafka-ui"| KafkaUI
%% API Gateway ๋ด ์๋น์ค ํธ์ถ
API_Gateway -->|"์๋น์ค ๋์ค์ปค๋ฒ๋ฆฌ"| Eureka
API_Gateway -->|"์๋น์ค ํธ์ถ"| AuthService
%% ์คํ์ผ ์ ์
classDef publicService fill:#ffcc99,stroke:#ff9933,stroke-width:2px
classDef privateService fill:#99ccff,stroke:#3366cc,stroke-width:2px
classDef monitoring fill:#ccffcc,stroke:#33aa33,stroke-width:2px
class NGINX publicService
class API_Gateway,Eureka,AuthService,UserService,ProductService privateService
class Grafana,KafkaUI monitoring
- ๋ชจ๋ ๊ฐ๋ฐ์ ๋๊ตฌ์ ๋ชจ๋ํฐ๋ง ์๋น์ค๋ ๋์ผํ NGINX ํ๋ก์๋ฅผ ํตํด ์ ๊ทผํ๋๋ก ๊ตฌ์ฑํจ.
-
NGINX๋ฅผ ํผ๋ธ๋ฆญ ์ธ์คํด์ค์ ๋จ๋ ๋ฐฐ์น
ํ๊ณ๋๋จธ์ง ๋ชจ๋ ์๋น์ค๋ฅผ ํ๋ผ์ด๋น ๋คํธ์ํฌ์ ๋ฐฐ์นํจ
์ผ๋ก์จ ๋ณด์๊ณผ ์ ๊ทผ์ฑ์ ๊ท ํ์ ์ ์งํ๋ฉฐ ๋คํธ์ํฌ ์ฐ๊ฒฐ ๋ฌธ์ ํด๊ฒฐํจ. - ์ด๋ ๋จ์ํ๋ฉด์๋ ํจ๊ณผ์ ์ธ ์ํคํ ์ฒ๋ก ๋ง์ดํฌ๋ก์๋น์ค ๊ฐ ํต์ ์ ์ํํ ํจ.