Skip to content

Instantly share code, notes, and snippets.

@leapar
Last active April 24, 2017 10:36
Show Gist options
  • Save leapar/db49aa3bb8f1124dddfdbda2a13f32dd to your computer and use it in GitHub Desktop.
Save leapar/db49aa3bb8f1124dddfdbda2a13f32dd to your computer and use it in GitHub Desktop.
环境配置.md

Ubuntu安装kong kong-dashboard bosun

@leapar
Copy link
Author

leapar commented Apr 24, 2017

Ubuntu安装kong

安装kong

#https://getkong.org/install/ubuntu/
wget https://github.com/Mashape/kong/releases/download/0.10.1/kong-0.10.1.xenial_all.deb
sudo apt-get update
sudo apt-get install openssl libpcre3 procps perl
sudo dpkg -i kong-0.10.1.*.deb

postgres 安装

sudo apt-get install postgresql
sudo -u postgres psql
CREATE USER kong; CREATE DATABASE kong OWNER kong;
ALTER USER kong WITH PASSWORD 'kong';
\q
/etc/init.d/postgresql restart

配置kong

sudo cp kong.conf.default kong.conf
sudo vi kong.conf

database = postgres             # Determines which of PostgreSQL or Cassandra
                                 # this node will use as its datastore.
                                 # Accepted values are `postgres` and
                                 # `cassandra`.
pg_host = 127.0.0.1             # The PostgreSQL host to connect to.
pg_port = 5432                  # The port to connect to.
pg_user = kong                  # The username to authenticate if required.
pg_password = kong              # The password to authenticate if required.
pg_database = kong              # The database name to connect to.

启动kong

kong check /etc/kong/kong.conf
kong start -vv

Ubuntu安装kong-dashboard

nodejs

wget https://nodejs.org/dist/v6.10.2/node-v6.10.2-linux-x64.tar.xz
tar -xJf node-v6.10.2-linux-x64.tar.xz
sudo mv node-v6.10.2-linux-x64 /opt/
sudo ln -s /opt/node-v6.10.2-linux-x64/bin/node /usr/local/bin/node
sudo ln -s /opt/node-v6.10.2-linux-x64/bin/npm /usr/local/bin/npm
npm install -g cnpm --registry=https://registry.npm.taobao.org
sudo ln -s /opt/node-v6.10.2-linux-x64/bin/cnpm /usr/local/bin/cnpm

kong-dashboard

cnpm install -g kong-dashboard
sudo ln -s /opt/node-v6.10.2-linux-x64/bin/kong-dashboard /usr/local/bin/kong-dashboard
kong-dashboard start -p 9001

Ubuntu安装bosun

git clone https://github.com/leapar/bosun.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment