Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start Kong?

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?

like image 959
Mallikarjuna Reddy Avatar asked Nov 05 '17 21:11

Mallikarjuna Reddy


People also ask

What is Kong and how it works?

Kong is an open source API gateway and platform that acts as middleware between compute clients and the API-centric applications. The platform easily extends the capabilities of APIs with the use of plugins.


3 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

like image 114
beebek Avatar answered Oct 20 '22 20:10

beebek


your command is right, you just have to remove the "[" from the commands. That's an indication of optional argument in the kong-documentaion. So the right command would just be:

kong start -c /path/to/your/kong.conf

Make sure to have updated and uncommented out the following fields in the kong.conf beforehand:

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)

If the proposed solution helped you, kindly close the question by accepting it as the answer. Thanks!

like image 3
Aman Singh Avatar answered Oct 20 '22 22:10

Aman Singh


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)

like image 1
Dubrzr Avatar answered Oct 20 '22 20:10

Dubrzr