1. 程式人生 > >kong 搭建安裝

kong 搭建安裝

kong

一、下載安裝kong和postgresql

wget https://dl.bintray.com/mashape/kong-rpm-el6-0.10.x/0.10.3/kong-0.10.3.el6.noarch.rpm

rpm -ivh kong-0.10.3.el6.noarch.rpm

yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm -y

yum install postgresql96 -y

yum install postgresql96-server -y


二、初始化啟動postgresql

service postgresql-9.6 initdb

chkconfig postgresql-9.6 on
service postgresql-9.6 start

三、設置postgresql密碼,建立kong 庫

1、su postgres
2、psql
alter user postgres with password ‘1234560.‘;
CREATE USER kong; CREATE DATABASE kong OWNER kong;

\q

四、修改kong鏈接數據得級別為password

1、vi /var/lib/pgsql/9.6/data/pg_hba.conf

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all password
# IPv4 local connections:
host all all 127.0.0.1/32 password
host all all 0.0.0.0/0 password


# IPv6 local connections:
host all all ::1/128 ident

2、service postgresql-9.6 restart

五、設置kong 連接postgresql 密碼

1、cd /etc/kong/

2、cp kong.conf.default kong.conf

3、vim kong.conf

pg_user = kong # The username to authenticate if required.
pg_password = kong # The password to authenticate if required.
pg_database = kong

4、vim /etc/profile
export KONG_SERF_PATH="/usr/local/bin/serf"

六、啟動kong

kong start


kong 搭建安裝