安装 Konga 后,我们尝试在已经运行的 Postgresql 数据库上准备 Konga 数据库。通过使用建议的命令,即
node ./bin/konga.js prepare --adapter postgres --uri postgresql://localhost:5432/konga
但是我们面临如下错误:
Error creating a connection to Postgresql using the following settings:
postgresql://localhost:5432/konga?host=localhost&port=5432&schema=true&ssl=false&adapter=sails-postgresql&user=postgres&password=XXXX&database=konga_database&identity=postgres
* * *
Complete error details:
error: password authentication failed for user "root"
error: A hook (`orm`) failed to load!
error: Failed to prepare database: error: password authentication failed for user "root"
我们甚至手动创建了模式 konga_database 并尝试了几种准备命令的变体,但没有命运
node ./bin/konga.js prepare --adapter postgres --uri postgresql://kong:XXXX@localhost:5432/konga_database
node ./bin/konga.js prepare --adapter postgres --uri postgresql://kong@localhost:5432/konga
node ./bin/konga.js prepare --adapter postgres --uri postgresql://kong@localhost:5432/konga_database
下面是 config/connections.js
postgres: {
adapter: 'sails-postgresql',
url: process.env.DB_URI,
host: process.env.DB_HOST || 'localhost',
user: process.env.DB_USER || 'postgres',
password: process.env.DB_PASSWORD || 'XXXX',
port: process.env.DB_PORT || 5432,
database: process.env.DB_DATABASE ||'konga_database',
// schema: process.env.DB_PG_SCHEMA ||'public',
// poolSize: process.env.DB_POOLSIZE || 10,
ssl: process.env.DB_SSL ? true : false // If set, assume it's true
},
下面是 .env 文件配置
PORT=1337
NODE_ENV=production
KONGA_HOOK_TIMEOUT=120000
DB_ADAPTER=postgres
DB_URI=postgresql://localhost:5432/konga
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=XXXX
KONGA_LOG_LEVEL=info
TOKEN_SECRET=
kong 和 postgresql 已经在 AWS linux AMI 2 服务器上运行在各自的端口上,即 8443 和 5432
请帮助我们准备数据库并启动 konga 服务。还。如果您需要更多信息,请告诉我们。
Node v: v12.19.0
NPM v: 6.14.8
问候 Nitin G