CKA Note Section 13 Troubleshooting
235. Application Failure
厚,debug 到眼睛快脫窗
- 先開 App Web 頁面查看錯誤訊息 (不確定正式考試時網頁是不是也設計成顯示錯誤訊息),判斷可能出問題的地方
- 第一題網頁能開判斷 Web pod + service => 無問題,網頁顯示
-2 Name does not resolve
=> 連不到 DB => 往mysql-service
“DNS name” 查找 - 第二題一樣,網頁顯示
111 Connection refused
=>
(1) 拒絕 => DB credential 有問題 => 要嘛在 Web pod env 不然就是 db pod env
(2)svc
port 號OR
selector 錯誤OR
pod 身上 port 錯誤 - 第三題 網頁直接打不開啊! => 等待時間先去查 web svc =>
curl http://<svc_IP>:<port>
(1) 後來噴出 504 Gateway Error => 5xx 系列 server 內部問題 => 都要查! (包含 web svc)槓(2)k get all -o wide
先看一下能不能看出端倪,果然看到selector:name=sql00001
=>k get pod mysql --show-labels
- 第四題 env
DB_User
不符合題目要求。 - 第五題 兩個 issue,第一個承上題。
Access denied for user 'root'@'10.42.0.20' (using password: YES)
=> 這 error 是 DB 噴的代表 DB svc 沒問題 - 第六題 三個 issue
(1)web-service
NodePort
錯誤
(2) envDB_User
錯誤