安装(部署)API-Gateway Kong的详细步骤

阅读更多
[0/4]
openresty version =>1.13.6.1
KongServer version =>v0.13.1
KongDashboard =>v0.3.3.0
PostgreSQL => 10.1 => Schema:kong || User:kong
using installed_ware_of_kong_20180927.zip
[1/4] install node and npm to setting npm for specified vesion
# xz -d node-v8.11.3-linux-x64.tar.xz

# tar -xvf ./node-v8.11.3-linux-x64.tar

# vim /etc/profile
//////////begin///////
export NODE_HOME=/opt/node

export PATH=${NODE_HOME}/bin/:${PATH}
//////////end/////////

# source /etc/profile

[2/4] create kong account
Note:pg's release version is mandatory
PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18), 64-bit =>ok
PostgreSQL 10beta2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18), 64-bit => NOT ok
1> create user kong with password 'kong@yourOwnerPwd';
   or =>alter user kong with password 'kong@yourOwnerPwd';
2> CREATE DATABASE kong OWNER kong;
3> grant all privileges on database kong to kong;

[3/4]install kong
# yum install -y perl-Time-HiRes.x86_64
# rpm -Uvh  kong-community-edition-0.13.1.el6.noarch.rpm
  => OR rpm -Uvh --force --nodeps kong-community-edition-0.13.1.el6.noarch.rpm
# cp /etc/kong/kong.conf.default /etc/kong/kong.conf

# vim /etc/kong/kong.conf => configure postgresql port and password

# /usr/local/bin/kong migrations up [-c /usr/local/etc/kong/kong.conf]

# /usr/local/bin/kong start [-c /usr/local/etc/kong/kong.conf]

[4/4] install and start kong-dashboard
# npm config set strict-ssl false
# npm install -g [email protected]
/opt/node/bin/kong-dashboard -> /opt/node/lib/node_modules/kong-dashboard/bin/kong-dashboard.js
+ [email protected]
added 185 packages in 23.922s

[Last]
1> modify logs directory
mkdir -p /data/kong/logs/
vim /etc/kong/kong.conf
2> modify logs format







你可能感兴趣的:(kong,API-Gateway,Linux,npm)