Installing API gateways Some of the pits and solutions that the Kong encounters

Source: Internet
Author: User
Tags postgresql psql create database

Install API Gateway Kong (https://getkong.org/) need to install Openresty and PostgreSQL First, here on my installation of the problems encountered and solutions to record, for your reference.


Openresty installation is very smooth, here simply paste:

Yum install-y pcre-devel openssl-devel gcc curl zlib zlib-devel
./configure--with-pcre-jit--with-ipv6--with-http_ Realip_module--with-http_ssl_module--with-http_stub_status_module--with-http_v2_module make
&& make Install
export path= "$PATH:/usr/local/openresty/bin"

Install PostgreSQL with Yum on the official website:

Yum Install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6-x86_64/ pgdg-redhat94-9.4-2.noarch.rpm
yum Install postgresql94
yum install postgresql94-server
Service postgresql-9.4 Initdb

Here unexpectedly encountered can not initdb problem, and only show initing database [FAILED], also did not show the specific failure reason, no way can only uninstall, and then compile the source of the way to install, recommended installation here postgresql-9.5, because version 9.4 is running the Kong migrations Up command and inexplicably failed:



Paste the PostgreSQL compilation installation process:

wget https://ftp.postgresql.org/pub/source/v9.5.10/postgresql-9.5.10.tar.gz
Tar zxvf  postgresql-9.5.10.tar.gz
cd postgresql-9.5.10
./configure make
&& make install
useradd-d/ Home/postgres-m postgres
mkdir/usr/local/pgsql/data
chown postgres/usr/local/pgsql/data
su-postgres
/usr/local/pgsql/bin/initdb-d/usr/local/pgsql/data

Then modify the login authentication profile for PostgreSQL/usr/local/pgsql/data/pg_hba.conf

Change the ident inside to trust, otherwise Kong cannot connect to the database as follows:



Then start PostgreSQL:

/usr/local/pgsql/bin/pg_ctl-d/usr/local/pgsql/data-l ~/pgsql.log Start

Create the database required by the Kong Runtime:

[Postgres@iz239kse8fez ~]$ psql 
psql (9.5.10)
Type ' help ' for help.

postgres=# create User Kong;
postgres=# CREATE DATABASE Kong owner Kong;

Attach the close PostgreSQL command:

/usr/local/pgsql/bin/pg_ctl-d/usr/local/pgsql/data Stop

The installation of Kong is also very simple, paste it (remember to cut back to the root user):

wget Https://bintray.com/kong/kong-community-edition-rpm/rpm-O Bintray-kong-kong-community-edition-rpm.repo
MV bintray-kong-kong-community-edition-rpm.repo/etc/yum.repo.d/
Yum install-y kong-community-edition

Then Kong migrations up and Kong start is OK.

Everyone in the installation process if there are any other problems, you can leave a message to discuss ^ ^




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.