1.17. 通过访问 PostgreSQL 数据库进行故障排除
1.17.1. 症状:带有多集群全局 hub 的错误 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
您可能会遇到多集群全局 hub 的各种错误。您可以访问置备的 PostgreSQL 数据库来查看对多集群全局 hub 问题进行故障排除的信息。
1.17.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-postgresql-0 -c multicluster-global-hub-postgresql -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-postgresql-0 -c multicluster-global-hub-postgresql -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 运行以下命令来获取凭证:
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