您目前查看的是 Apigee Edge 說明文件。
前往 Apigee X 說明文件。 info
問題
在新版 Edge UI 的 Analytics 自訂報表中,使用統計資料收集器政策建立的自訂變數不會顯示在「自訂維度」下方。
錯誤訊息
重新啟動後,edge-postgres-server 系統記錄會針對每個路徑遺失的機構/環境組合,顯示下列錯誤:
KeeperErrorCode = NoNode for /organizations/<ORG>/environments/<ENV>/properties 2018-03-29 16:14:48,980 pool-10-thread-2 ERROR ZOOKEEPER - ZooKeeperServiceImpl.getData() : Could not get data for path: /organizations//environments/ /properties, reason: KeeperErrorCode = NoNode for /organizations/ /environments/ /properties
可能的原因
| 原因 | 說明 | 疑難排解操作說明適用對象 |
|---|---|---|
| 缺少組織和環境組合的 Zookeeper 屬性路徑。 | 如果缺少 ZooKeeper 路徑 /organizations/,就無法建立自訂維度。 |
Edge 私有雲使用者 |
原因:缺少組織和環境組合的 ZooKeeper 屬性路徑
診斷
透過
啟用 Analytics API,為組織與環境組合啟用 Analytics,這會填入 ZooKeeper 樹狀結構中的 /organizations/。如果這個 API 失敗,edge-postgres-server 元件就無法建立自訂維度,且系統記錄中會顯示下列錯誤:
KeeperErrorCode = NoNode for /organizations/example/environments/prod/properties 2018-03-29 16:14:48,980 pool-10-thread-2 ERROR ZOOKEEPER - ZooKeeperServiceImpl.getData() : Could not get data for path: /organizations/example/environments/prod/properties, reason: KeeperErrorCode = NoNode for /organizations/digi/environments/sandbox/properties
這通常發生在組織上線時,有多個分析群組使用相同的 postgres-server UUID。如要查看現有的數據分析群組數量,請執行下列 API 呼叫:
curl -u username:password "http://management-server-host:8080/v1/analytics/groups/ax"
如果這個 API 傳回多個群組,則很可能是問題的原因。在下列範例中,請注意有兩個群組,兩者只差一個連字號: axgroup-001 和 axgroup001
[ {
"name" : "axgroup-001",
"properties" : {
},
"scopes" : [ "VALIDATE~test" ],
"uuids" : {
"qpid-server" : [ "94c96375-1ca7-412d-9eee-80fda94f6e07" ],
"postgres-server" : [ "8ee86b70-5b33-44b6-b2f8-1b0ec0ec8d77" ]
},
"consumer-groups" : [ {
"name" : "consumer-group-001",
"consumers" : [ "94c96375-1ca7-412d-9eee-80fda94f6e07" ],
"datastores" : [ "8ee86b70-5b33-44b6-b2f8-1b0ec0ec8d77" ],
"properties" : {
}
} ],
"data-processors" : {
}
}, {
"name" : "axgroup001",
"properties" : {
},
"scopes" : [ "example~prod" ],
"uuids" : {
"qpid-server" : [ "94c96375-1ca7-412d-9eee-80fda94f6e07" ],
"postgres-server" : [ "8ee86b70-5b33-44b6-b2f8-1b0ec0ec8d77" ]
},
"consumer-groups" : [ {
"name" : "consumer-group-001",
"consumers" : [ "94c96375-1ca7-412d-9eee-80fda94f6e07" ],
"datastores" : [ "8ee86b70-5b33-44b6-b2f8-1b0ec0ec8d77" ],
"properties" : {
}
} ],
"data-processors" : {
}具體來說,如果為每個 axgroup 設定的 postgres-server UUID 相同,就會發生這個問題。如要快速判斷,請執行下列指令:
curl -u username:password "http://management-server-host:8080/v1/analytics/groups/ax"|grep -B7 "postgres-server"
下列輸出範例會快速比較 postgres-server UUID,判斷兩者是否相同:
{ "name" : "axgroup-001", "properties" : { }, "scopes" : [ "VALIDATE~test" ],
"uuids" : { "qpid-server" : [ "94c96375-1ca7-412d-9eee-80fda94f6e07" ],
"postgres-server" : [ "8ee86b70-5b33-44b6-b2f8-1b0ec0ec8d77" ]--
"name" : "axgroup001", "properties" : { }, "scopes" : [ "myorg~prod" ],
"uuids" : { "qpid-server" : [ "94c96375-1ca7-412d-9eee-80fda94f6e07" ],
"aries-datastore" : [ ], "postgres-server" : [ "8ee86b70-5b33-44b6-b2f8-1b0ec0ec8d77" ],解析度
同一組 PostgreSQL 伺服器無法指派給兩個 axgroups。最快的解決方法是從一個 axgroup 刪除 postgres 伺服器資訊,並將所有範圍 (組織、環境組合) 指派給另一個群組。如要這麼做,請按照下列步驟操作:
- 按照「 在 Analytics 群組中新增及刪除 Analytics 元件」一文中的說明,從其中一個 axgroup 移除 postgres 伺服器元件。如果只有非正式環境範圍發生問題,請選擇「不」包含任何正式環境範圍的 axgroup 進行這項練習。否則,請選擇範圍數量最少的 axgroup。
- 從不再有任何 postgres 伺服器的 axgroup 中移除所有範圍,並從您看到自訂維度問題的 axgroup 中移除範圍。假設上述範例中的
axgroup-001是您要使用的群組,則必須使用下列指令,移除 myorg 機構和 prod 環境的範圍:curl -u username:password -X DELETE 'http://management-server-host:8080/v1/analytics/groups/ax/axgroup001/scopes?org=myorg&env=prod'
- 使用 啟用 Analytics API 啟用 Analytics。
- 使用下列指令,重新啟動 postgres 主節點上的 edge-postgres-server 元件,以及可能已安裝的所有 edge-qpid-server 元件:
/opt/apigee/apigee-service/bin/apigee-service edge-postgres-server restart
/opt/apigee/apigee-service/bin/apigee-service edge-qpid-server restart
- 確認上述「錯誤訊息」一節中提供的錯誤,不再出現在 Postgres 伺服器的記錄檔
/opt/apigee/var/log/edge-postgres-server/logs/system.log中。 - 確認自訂維度是否顯示在新版 Edge UI 中。
如果問題仍未解決,請參閱「必須收集的診斷資訊」。
必須收集的診斷資訊
如果按照上述指示操作後,問題仍未解決,請收集下列診斷資訊。請聯絡 Apigee Edge 支援團隊並提供這些資訊:
- 上次重新啟動時的 edge-postgres-server
/opt/apigee/var/log/edge-postgres-server/logs/system.log。 - 下列 Management API 呼叫的輸出內容:
curl -u username:password "http://management-server-host:8080/v1/analytics/groups/ax"
- 使用下列指令取得的 ZooKeeper 樹狀結構輸出內容:
/opt/apigee/apigee-zookeeper/contrib/zk-tree.sh > zktree-output.txt