A.
「資料中心故障排除指南」 — Gilles Dufour撰寫的部落格。
粘性(第2部分)
解決粘性的問題並非易事。
沒有調試選項可以瞭解ACE為什麼決定向特定伺服器傳送連線。
通過統計可以發現一些常見錯誤。
下面是最知名的。
1.無論您選擇哪種粘滯型別,不粘滯伺服器的原因都是粘滯條目超時或由於缺少粘滯資源而被刪除。因此,請使用以下命令檢查粘滯資源分配:
AceC6k2 Admin# show np 1 me-stats "-slb -v"
地址為0x82e的LB效能統計05000
地址為0x82e的LB效能統計05000
LB統計
--------------
(情景所有統計資訊)
...
盜用的重複使用數量: 0 0
有效粘滯條目數: 0 0
有效反向粘性條目數: 0 0
活動連線埠計數: 0 0
可用粘滯條目計數: 1794111 0
Num Grp or Timeout Nodes: 4 0
靜態條目清單計數: 0 0
Num Entry Configured: 1794111 0
上一資源請求: 1794111 0
Drop Max Remote Stky:
0 0
「Num Stolen For Reuse」表示沒有足夠的粘滯資源,並且為了儲存新粘滯條目而刪除了舊粘滯條目。這可能是粘滯失敗的原因。要解決此問題,可以增加粘滯資源或對於粘滯源ip,可以更改掩碼,以便一個條目可用於屬於同一子網的所有客戶端。
Drop Max Remote Stky"計算由於內部元件之間的通訊太慢而無法處理所有粘滯查詢而失敗的粘滯查詢數。
2.如果已配置任何形式的HTTP粘性(cookie、報頭……),則顯示粘滯失敗的一個原因是http分析錯誤。ACE需要解析HTTP報頭以查詢執行粘性所需的資訊(即:cookie)。 如果HTTP請求的格式不正確,ACE將無法正確解析資料,甚至不會嘗試執行粘滯查詢。 檢查命令:是否存在任何分析錯誤
AceC6k2/Admin# show np 1 me-stats "-shttp -v" | i pars
第二遍分析: 0 0
靜態分析錯誤: 0 0
最大引數錯誤: 0 0
AceC6k2/Admin#
如果您看到了「靜態分析錯誤」,可以解釋您的粘滯故障。 不幸的是,這裡沒有解決辦法。 使用ddts CSCtj42969
我們新增了一個新命令以繼續分析http資料,即使檢測到錯誤。 有關詳細資訊,請參閱上一篇部落格。
「Max parselen errors」是http標頭過大以及我們需要的資料位於緩衝區以外的結果。 可以使用引數對映調整分析緩衝區的大小
AceC6k2/Admin(config)# parameter-map type http ParseLen
AceC6k2/Admin(config-parammap-http)# set ?
content-maxparse-length配置內容maxparse長度
header-maxparse-length配置標頭maxparse長度
secondary-cookie-delimiters配置URL/COOKIE(cookie-in-url-query)分隔符
顯然,上述資料無法解釋所有可能的棘手問題。 我們經常需要捕獲監聽器跟蹤並定期轉儲粘滯表,以便嘗試瞭解正在發生的情況。
這就是我在4.1.x版中引入新命令以列出連結到特定粘滯條目的連線的原因。
CSCti03084
:Enh:show conn sticky — 顯示連結到粘滯的連線
以下是使用此新命令的方式。
首先,在「詳細資訊」模式下列出粘滯條目(命令處於隱藏狀態),並提取內部條目ID。
Scimitar1/Admin# show sticky data detail
processor (0/0): 0
results index: 1 of 1
sticky group: RESERVATIONS_STICKY
sticky type: IP
rserver: vmware-46
realPort: 80
timeout (secs): 1200
sticky-entry: 192.168.20.0
internal entry-id: 0x200004
time-to-expire (secs): 1198
stcky-hit-count: 63402
active-conn-count: 1
in-use reference count: 0
static entry: FALSE
reverse entry: FALSE
active entry: TRUE
timeout-active-conns: FALSE
created-from-HA-peer: FALSE
HA-replicated-at-least-once: TRUE
With the internal entry-id you can list all connections using that entry.
Scimitar1/Admin# show conn sticky 0x200004
conn-id np dir proto vlan source destination state
----------+--+---+-----+----+---------------------+---------------------+------+
653622 1 in TCP 20 192.168.20.45:47377 192.168.20.15:80 SYNSEEN
658234 1 out TCP 40 192.168.40.46:80 192.168.20.45:47377 INIT
Scimitar1/Admin#
還可以檢索連線使用的內部條目ID。
為此,您需要知道連線所關聯的conn-id和NP。
switch/Admin# show np 1 me-stats "-c 242"
Connection ID:seq: 242[0xf2].0
Other ConnID : 243[0xf3].0
Proxy ConnID : 0[0x0].0
Next Q : 0[0x0]
192.168.20.45:44425 -> 192.168.20.15:80 [RX-NextHop: TX] [TX-NextHop: TX]
Flags: PAT: No DynNAT: No Implicit PAT: No On_Reuse: No
L3 Protocol : IPv4 L4 Protocol : 6
Inbound Flag : 1
Interface Match : Yes
Interface MatchID: 3
EncapsID:ver : 45:0 TCP ACK delta : 0xc8228d7e
MSS : 1460 TOS Stamp : 0
Repeat mode : No Punt Flag : No
TOS Stamp : No TCP Window Check: No
ACE ID : 98 NAT Policy ID : 0
Post NAT hop : 0
Packet Count : 5 Byte Count : 309
TCP Information: (State = 3)
Window size : 6432 Window scale : 0
FIN seen : No FIN/ACK seen : No
FIN/ACK exp : No Close initiator : No
FIN/ACK expval: 5b40000 Last seq : 9f50cfc0
timestamp_delta: 0 Last ack : 947b3980
Data/ACK Trigger : 947b3980 Trigger Status : 1
Timestamp : 39cd8
TCP options negotiated:
Sack:Clear TS:Clear Windowscale: Clear
Reserved: Allow Exceed MSS: Deny Window var: Allow
Sticky Internal Entry-id : 0x200006
Raw Connection Entry
0000 0x00000000 0xc0a8142d 0xc0a8140f 0x06090003
0010 0xad890050 0xc8228d7e 0x002d0000 0x05b40000
0020 0x000000f3 0x00000000 0x080a2480 0x24450000
0030 0x00000005 0x00000135 0x19200030 0x05b40000
0040 0x9f50cfc0 0x947b3980 0x00039cd8 0x00000000
0050 0x00000062 0x947b3980 0x00039cb1 0x00000000
0060 0x00000000 0x00000000 0x00000000 0x00000000
0070 0x0000bc90 0x00000000 0x00000000 0x00000000
switch/Admin#
Can not view this . file attachment inline, please click on the following link to view the attachment.
http://cdetsweb-prd.cisco.com/apps/dumpcr_att?identifier=CSCti03084&title=Diffs-commit-converge_dev&ext=&type=FILE
Can not view this . file attachment inline, please click on the following link to view the attachment.
Can not view this . file attachment inline, please click on the following link to view the attachment.
http://cdetsweb-prd.cisco.com/apps/dumpcr_att?identifier=CSCti03084&title=Diffs-commit-converge_dev.p2&ext=&type=FILE
Can not view this . file attachment inline, please click on the following link to view the attachment.
Can not view this . file attachment inline, please click on the following link to view the attachment.
http://cdetsweb-prd.cisco.com/apps/dumpcr_att?identifier=CSCti03084&title=Scimitar-code-review&ext=&type=FILE
Can not view this . file attachment inline, please click on the following link to view the attachment.
我在4.1.x版中引入的另一個新功能是CSCth64697
:Enh:用於顯示http url/cookie雜湊結果的新show命令
| 什麼 | 有多壞 | 對象 | 版本 | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
| 歷史記錄 |
|---|
Histogram of CSCti03084 N -> A [ 0] | <-----------------------------------+-----------------------------------> |
| cdetsadm | 11/30/2010 15:15:24 | 整合版本: | —> 3.0(0)A90(7.0.12) |
| cdetsadm | 2010年1月11日13:42:20 | 整合版本: | —> 3.0(0)A4(1.0) |
| 格杜福爾 | 10/19/2010 00:22:06 | RNE-Approval-Flg: | 否 — > |
| 格杜福爾 | 10/19/2010 00:22:06 | 附註標題: | —> V-comments |
| 格杜福爾 | 10/19/2010 00:22:05 | 已驗證: | —> 10/19/2010 00:22:05 |
| 格杜福爾 | 10/19/2010 00:22:05 | 驗證程式: | —>格杜福 |
| 格杜福爾 | 10/19/2010 00:21:59 | Verified-confidence: | —>已測試 |
| 格杜福爾 | 10/19/2010 00:20:32 | 狀態: | R—> V |
| 格杜福爾 | 10/19/2010 00:22:05 | Verified-release: | —> 3.0(0)A4(1.0.5) |
| cms | 10/04/2010 07:12:07 | 檔名: | —> Scimitar-code-review |
| cdetsadm | 09/23/2010 10:30:36 | 整合版本: | —> 3.0(0)A90(4.0.38) |
| cdetsadm | 09/07/2010 11:35:29 | 整合版本: | —> 3.0(0)A4(0.99.214) |
| 格杜福爾 | 09/06/2010 00:56:13 | RNE-Approval-Flg: | 否 — > |
| 格杜福爾 | 09/06/2010 00:56:13 | 附註標題: | —> R-comments |
| 格杜福爾 | 09/06/2010 00:56:13 | 解決時間: | 07/29/2010 04:09:36 —> 09/06/2010 00:56:12 |
| 格杜福爾 | 09/06/2010 00:55:57 | 狀態: | A —> R |
| 迪夫賈因 | 09/06/2010 00:51:22 | RNE-Approval-Flg: | 否 — > |
| 迪夫賈因 | 09/06/2010 00:51:22 | 附註標題: | —> A-comments |
| 迪夫賈因 | 09/06/2010 00:51:22 | 分配者: | 古杜福—>迪夫延 |
| 迪夫賈因 | 09/06/2010 00:51:22 | 分配日期: | 07/26/2010 06:19:33 —> 09/06/2010 00:51:22 |
| 迪夫賈因 | 09/06/2010 00:51:07 | 狀態: | R—> A |
| 格杜福爾 | 09/06/2010 00:42:03 | 檔名: | —> Diffs-commit-converge_dev.p2 |
| cdetsadm | 08/25/2010 13:05:01 | 整合版本: | —> 3.0(0)A90(4.0.27) |
| 拉胡爾 | 08/01/2010 23:52:20 | 已找到: | de-test —>開發 |
| cdetsadm | 07/31/2010 07:09:49 | 整合版本: | —> 3.0(0)A4(0.99.180) |
| 卡文卡特 | 07/29/2010 14:19:33 | 屬性2: | Fusion —> FUSION |
| 格杜福爾 | 07/29/2010 04:09:36 | 解決時間: | —> 07/29/2010 04:09:36 |
| 格杜福爾 | 07/29/2010 04:09:28 | 文檔已更改: | —>無 |
| 格杜福爾 | 07/29/2010 04:09:28 | 狀態: | O —> R |
| 格杜福爾 | 07/29/2010 04:05:46 | 檔名: | —> Diffs-commit-converge_dev |
| 格杜福爾 | 07/28/2010 02:03:37 | 回歸: | —>否 |
| 格杜福爾 | 07/28/2010 02:03:47 | 代碼審閱者: | —>布蘭科 |
| 格杜福爾 | 07/28/2010 02:02:52 | 附註: | Static-analysis-runinfo —> Static-analysis-runinfo |
| 格杜福爾 | 07/28/2010 01:59:11 | RNE-Approval-Flg: | 否 — > |
| 格杜福爾 | 07/28/2010 01:59:11 | 附註標題: | —> Static-analysis-runinfo |
| 格杜福爾 | 07/26/2010 08:04:54 | RNE-Approval-Flg: | 否 — > |
| 格杜福爾 | 07/26/2010 08:04:54 | 附註標題: | —> AUT |
| 格杜福爾 | 07/26/2010 07:21:27 | 狀態: | A—> O |
| cms | 07/26/2010 07:17:50 | 檔名: | —> Scimitar-code-review |
| 格杜福爾 | 07/26/2010 06:24:00 | RNE-Approval-Flg: | 否 — > |
| 格杜福爾 | 07/26/2010 06:24:00 | 附註標題: | —>單元測試 |
| 格杜福爾 | 07/26/2010 06:19:54 | 附註標題: | —> Release-note |
| 格杜福爾 | 07/26/2010 06:19:33 | 分配者: | —>格杜福 |
| 格杜福爾 | 07/26/2010 06:19:33 | 分配日期: | —> 07/26/2010 06:19:33 |
| 格杜福爾 | 07/26/2010 06:19:33 | 工程師: | —>格杜福 |
| 格杜福爾 | 07/26/2010 06:19:28 | 狀態: | N —> A |
| 格杜福爾 | 07/26/2010 06:19:18 | 已建立缺陷: | —> |
以下是有關如何使用此命令的示例。
粘滯函式經常將輸入資料雜湊為64位值。 這是我們儲存在粘滯條目中的值,用於將新輸入資料與現有條目進行匹配。
因此,當顯示粘滯資料庫時,通常會出現一個數量龐大的粘滯條目。
從雜湊值中檢索原始資料是不可能的。
ctw1prod001/maxcon# show sticky database group group1
sticky group : group1
type : HTTP-COOKIE
timeout : 5 timeout-activeconns : TRUE
sticky-entry rserver-instance time-to-expire flags
---------------------+--------------------------------+--------------+-------+
18119923635054054134 rser3:0 293 -
5834233610907968705 rser2:0 6 -
Until version 4.1.x it was also impossible to know the hash value from the original data.
This is why the command show sticky hash is useful. This command will hash whatever text you provide and return the hash value in hexadecimal and decimal.
ctw1prod001/maxcon# show sticky hash cisco123
Hash: 0x50f75c8edad064c1 - 5834233610907968705
ctw1prod001/maxcon# show sticky hash testing123
Hash: 0xfb76e68ae89a0af6 - 18119923635054054134
ctw1prod001/maxcon#
In the example above, the text cisco123 is hashed into value 5834233610907968705
This value correspond to the sticky entry pointing to rser2:0
Below is another example with cookie insert.
ctw1prod001/maxcon# sh sticky cookie-insert group group1
Cookie | HashKey | rserver-instance
------------+----------------------+----------------------------------------+
R876364218 | 8016668853981260554 | s1/rser1:0
R876365307 | 1555693097661300743 | s1/rser2:0
R876366396 | 9600904050871858939 | s1/rser3:0
R876367485 | 3122196043780649991 | s1/rser4:0
R2830679934 | 17805359266603035579 | s2/rser4:0
R2830681023 | 81717080676150073 | s2/rser5:0
ctw1prod001/maxcon# sh sticky hash R876364218
Hash: 0x6f40edd93b7dab0a - 8016668853981260554
ctw1prod001/maxcon# sh sticky hash R2830681023
Hash: 0x12251407dc8ab39 - 81717080676150073
ctw1prod001/maxcon#
這將結束我們的忠誠度評估。
謝謝,
吉爾斯·杜福
| 修訂 | 發佈日期 | 意見 |
|---|---|---|
1.0 |
15-Jul-2026
|
初始版本 |