1.18. PostgreSQL データベースにアクセスしてトラブルシューティング
1.18.1. 症状: Multicluster Global Hub のエラー リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
Multicluster Global Hub ではさまざまなエラーが発生する可能性があります。プロビジョニングされた PostgreSQL データベースにアクセスして、Multicluster Global Hub の問題のトラブルシューティングに役立つメッセージを表示できます。
1.18.2. 問題の解決: PostgresSQL データベースへのアクセス リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
There are two ways to access the provisioned PostgreSQL database.
There are two ways to access the provisioned PostgreSQL database.
ClusterIPサービスの使用oc exec -it multicluster-global-hub-postgres-0 -c multicluster-global-hub-postgres -n multicluster-global-hub -- psql -U postgres -d hoh # Or access the database installed by crunchy operator oc exec -it $(kubectl get pods -n multicluster-global-hub -l postgres-operator.crunchydata.com/role=master -o jsonpath='{.items..metadata.name}') -c database -n multicluster-global-hub -- psql -U postgres -d hoh -c "SELECT 1"oc exec -it multicluster-global-hub-postgres-0 -c multicluster-global-hub-postgres -n multicluster-global-hub -- psql -U postgres -d hoh # Or access the database installed by crunchy operator oc exec -it $(kubectl get pods -n multicluster-global-hub -l postgres-operator.crunchydata.com/role=master -o jsonpath='{.items..metadata.name}') -c database -n multicluster-global-hub -- psql -U postgres -d hoh -c "SELECT 1"Copy to Clipboard Copied! Toggle word wrap Toggle overflow LoadBalancerデフォルトでプロビジョニングされた
LoadBalancerにサービスタイプを公開します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow 認証情報を取得するには、次のコマンドを実行します。
# Host oc get svc postgres-ha -ojsonpath='{.status.loadBalancer.ingress[0].hostname}' # Password oc get secrets -n multicluster-global-hub postgres-pguser-postgres -o go-template='{{index (.data) "password" | base64decode}}'# Host oc get svc postgres-ha -ojsonpath='{.status.loadBalancer.ingress[0].hostname}' # Password oc get secrets -n multicluster-global-hub postgres-pguser-postgres -o go-template='{{index (.data) "password" | base64decode}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Crunchy Operator によってプロビジョニングされた
LoadBalancerにサービスタイプを公開します。oc patch postgrescluster postgres -n multicluster-global-hub -p '{"spec":{"service":{"type":"LoadBalancer"}}}' --type mergeoc patch postgrescluster postgres -n multicluster-global-hub -p '{"spec":{"service":{"type":"LoadBalancer"}}}' --type mergeCopy to Clipboard Copied! Toggle word wrap Toggle overflow 認証情報を取得するには、次のコマンドを実行します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow