Ubuntu Linux and Kong

Install and use Kong with Ubuntu.

Ubuntu and Kong installation documentation

I’m trying to install kong on an ubuntu server. I have postgreSQL. Everything is setup as mentioned in the documentation. However, when I make any kong command like ‘kong start’. I get no output or feedback. I tried --vv and that didn’t help either.

Let me know if I need to any more details.

Thanks

@sghata Hi,

What do you see when you run which kong? Is there anything in /usr/local/kong? Can you locate a kong executable anywhere in your system?

@thibaultcha Yes, I definitely have it:
/usr/local/bin/kong

What precisely do you mean by “no output”? Do you get “command not found” in the shell, or is the output fully silent? What do you get in the shell if you run echo $? after running kong start?

@hisham The output is fully silent.
Here:
sghata@galaxy:~$ kong start
sghata@galaxy:~$ echo $
$

Ah, I meant echo $? as in dollar-questionmark:

hisham@proxy ~/work/kong/kong] kong start -c kong.conf
2017/12/08 17:12:45 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
Kong started
hisham@proxy ~/work/kong/kong]echo $?                
0

I got 132

sghata@galaxy:~$ echo $?
132

Odd, exit code 132 means SIGILL – illegal instruction. What processor type are you running this on?

AMD Opteron™ Processor 6134

Searching for this processor type and SIGILL it seems this model has limitations on the version of SSE supported:
https://github.com/lh3/minimap2/issues/21

How did you install Kong, from .deb packages? It may be worth trying building from source, so it compiles to your specific processor:

https://getkong.org/install/source/

1 Like

To circle back on this, indeed the default OpenResty build requires SSE4.2, and this processor generation does not have it. You will need to build OpenResty yourself, see http://openresty.org/en/linux-packages.html. (For reference, see also https://github.com/Kong/kong/issues/3080)

1 Like

@hisham thank you for your help. After playing with this for a bit, I wanted to share what I did to solve the issue.
OpenResty 1.11.2.5 has the support to detect if the system has SSE4.2 or not. However Kong only supports 1.11.2.4
I had to add the below commit to 1.11.2.4 and add --with-luajit-xcflags=’-mno-sse4.2’ to the configure to get it to work

Great to know! Thank you for sharing this. Kong keeps track of OpenResty releases, so rest assured this will arrive in Kong itself soon. :slight_smile:

1 Like

BTW, even with newer versions of OpenResty that can detect a lack of SSE4.2 support, we build official Kong packages on a pipeline that has support for these instructions sets. So all Kong packages will indeed be required to run on hardware that supports these instructions, regardless of OpenResty version, because this detection functionality applies as compile time, not run time. So the only solution to run on legacy hardware will indeed be to compile OpenResty for your particular architecture and instruction set support.

2 Likes

I am using kong-0.12.1 and postgres-9.5.11, created a postgres user kong with kong as password and new db named kong. I gave pg_password=kong on kong.conf. But still kong wont migrate or start. It gives me this message
Error:
/usr/local/share/lua/5.1/kong/cmd/start.lua:62: /usr/local/share/lua/5.1/pgmoon/init.lua:271: missing password, required for connect

Is there anything more to installation?

@byra I think your password is not set properly to user kong user.
try this below query to set the password.

ALTER USER kong WITH PASSWORD 'kong';

I did change password as above. And gave the parameter updated parameter pg_password = kong on kong.conf file. Are you able to install and run Kong 0.12.1?

Yes @byra
I found one new thing. It always read kong.conf file, not kong.conf.default.
You need to do one thing, rename kong.conf.default -> kong.conf

Use below command for rename

 sudo mv /etc/kong/kong.conf.default /etc/kong/kong.conf

And then migration command

sudo kong migrations up

Start kong

sudo kong start

Right @kd_kd
One more step before running migrations is commenting out postgres details in kong.conf
Now I am able to run.

Thank you