Friday, December 8, 2017

Kong Installation

The following instruction is for CentOS7 only

Install Kong

rpm -ivh https://bintray.com/kong/kong-community-edition-rpm/download_file?file_path=dists/kong-community-edition-0.11.1.el7.noarch.rpm
yum install epel-release
yum install kong-community-edition

Install & prepare Database

Kong needs a database and supports both PostgreSQL 9.4+ and Cassandra 3.x.x as its datastore. In our POC we have tested it with Postgres 9.6
yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum install postgresql96-server.x86_64
yum install postgresql96
/usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl enable postgresql-9.6
systemctl start postgresql-9.6

su - postgres
psql
CREATE USER kong; CREATE DATABASE kong OWNER kong;
Now, run the Kong migrations:
sudo kong migrations up [-c /path/to/kong.conf]

Run Kong on port 80 for HTTP

Edit /etc/kong/kong.conf Change: proxy_listen = 0.0.0.0:8000 To: proxy_listen = 0.0.0.0:80
sed -i "s/proxy_listen = 0.0.0.0:8000/proxy_listen = 0.0.0.0:80/" /etc/kong/kong.conf

Start Kong

kong start

Increase nofile

Default file descriptor in CentOS7 is set to 1024, to increase this value for more connections to Kong:
cat >>  etc/security/limits.conf < EOF
*       soft    nofile  32767
*       hard    nofile  32767
EOF

No comments: