当我尝试在Ubuntu中启动Kong时,我遇到了以下错误
kong start [-c /path/to/kong.conf]
prefix directory /usr/local/kong not found, trying to create it
2017/11/05 21:11:41 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
Error: /usr/local/share/lua/5.1/pgmoon/init.lua:271: missing password, required for connect
我错过了什么
答案 0 :(得分:1)
运行以下命令。
CREATE USER kong; CREATE DATABASE kong OWNER kong;
ALTER USER kong WITH PASSWORD 'password';
使用以下内容创建一个kong.config。
pg_user = kong
pg_password = password
运行迁移并启动kong(可能需要sudo)
$ kong migrations up -c kong.config
$ kong start -c kong.config
答案 1 :(得分:0)
你的命令是对的,你只需要从命令中删除“[
”。这表明了kong-documentaion中的可选参数。
所以正确的命令就是:
kong start -c /path/to/your/kong.conf
请务必事先在kong.conf
中更新并取消注释以下字段:
database = postgres (as in your case)
pg_host = your_host_address (127.0.0.1 by default)
pg_port = your_psql_port_address (5432 by default)
pg_user = your_psql_db_user (kong as per documentation of kong)
pg_password = your_psql_db_user's_password
pg_database = your_db_for_kong (kong as per documentation of kong)
答案 2 :(得分:0)
我有同样的错误,可能是您的postgresql版本太旧了:
kong start -c kong.conf 错误:[postgres错误] Kong需要PostgreSQL 9.5或更高版本(当前使用9.2)
答案 3 :(得分:0)
就我而言,我通过提供 kong.conf 文件的自定义路径来尝试使用 kong migrations bootstrap
命令,但得到了完全相同的错误:missing password, required for connect
在 kong migrations bootstrap
的详细日志中,我看到该命令总是在一组预定义的路径中查找 conf 文件
kong migrations bootstrap ./kong.conf --v
2021/02/05 09:51:52 [verbose] Kong: 2.3.1
2021/02/05 09:51:52 [verbose] no config file found at /etc/kong/kong.conf
2021/02/05 09:51:52 [verbose] no config file found at /etc/kong.conf
2021/02/05 09:51:52 [verbose] no config file, skip loading
所以我将我的 kong.conf 文件复制到 /etc/kong/ 并且它开始工作正常
答案 4 :(得分:0)