如何将 amazon aurora rds postgresql 与 EKS 集群中运行的 Parse 服务器连接?

How to connect amazon aurora rds postgresql with Parse server running in a EKS cluster?

提问人:kathoraja 提问时间:7/16/2023 更新时间:7/16/2023 访问量:82

问:

我一直在尝试在我的 EKS 集群上启动解析服务器。但是 Pod 失败,并给出错误:不存在数据库“dbname”。我在连接到RDS postgreSQL的服务器(nakama游戏服务器)上部署了另一个应用程序。用于两个 RDS 的安全组完全相同。所以我不明白为什么解析服务器找不到数据库。

这是 Pod 抛出的错误--->

error: database "database-2" does not exist
    at Parser.parseErrorMessage (/parse-server/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/parse-server/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/parse-server/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/parse-server/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 95,
  severity: 'FATAL',
  code: '3D000',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'postinit.c',
  line: '989',
  routine: 'InitPostgres'
}

这是配置.js -->

const ParseServer = require("parse-server").ParseServer;
    const databaseUri =
      "postgresql://username:password@database-2.cluster-cum5cpuwordc.ap-south-1.rds.amazonaws.com:5432/database-2";
    const parseServerConfig = {
      appId: "assessment-service",
      masterKey: "masterKey",
      clientKey: "client-key",
      appName: "relive",
      cloud: "./cloud/main",
      // serverURL: "http://<your-parse-server-url>/parse",
      databaseURI: databaseUri,
    };

如果您需要更多信息,请告诉我。

重新检查数据库 URI

amazon-eks 解析服务器 amazon-aurora

评论

0赞 kathoraja 7/16/2023
我尝试在同一节点组中创建一个调试 Pod,并使用 psql 尝试从调试 pod 中连接到 Aurora 数据库。抛出数据库不存在的相同错误。所以DB的URL似乎有问题。

答: 暂无答案