How to start Kong?

Viewed 5939

I am getting following error, when I tried to start Kong in Ubuntu

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

Am I missing anything?

5 Answers

on your psql run the following. CREATE USER kong; CREATE DATABASE kong OWNER kong; ALTER USER kong WITH PASSWORD 'password';

create a kong.config with following content. pg_user = kong pg_password = password

Run the migration and start kong (might require sudo) $ kong migrations up -c kong.config $ kong start -c kong.config

I have the same error, probably that your postgresql version is too old :

kong start -c kong.conf Error: [postgres error] Kong requires PostgreSQL 9.5 or greater (currently using 9.2)

In my case, I was trying out the kong migrations bootstrap command by providing a custom path to the kong.conf file and I was getting the exact same error: missing password, required for connect

and in the verbose logs of kong migrations bootstrap I saw that the command always looks for the conf file in a set of pre-defined paths

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

So I copied my kong.conf file to /etc/kong/ and it started working fine

once you go with @beebek's solution then you need to change the corresponding changes on the config files and then bootstrap the migrations with the command

kong migrations bootstrap

If you are on ubuntu follow with this doc

docs

And if you are looking into the db-less docs, Here is one

db-less

Related