apache apisix和apisix-dashboard安装步骤
1. 安装Openresty、etcd、luarocks
1.1 Openresty安装
# 添加 OpenResty 源
yum install yum-utils
yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
# 安装 OpenResty 和 编译工具
yum install -y openresty curl gcc
1.2 etcd安装
wget https://github.com/etcd-io/etcd/releases/download/v3.4.13/etcd-v3.4.13-linux-amd64.tar.gz
tar -xvf etcd-v3.4.13-linux-amd64.tar.gz && \
cd etcd-v3.4.13-linux-amd64 && \
cp -a etcd etcdctl /usr/local/bin/
启动:nohup etcd &
1.3 luarocks安装
# 安装luarocks和依赖
yum install -y git luarocks lua-devel
1.4. apisix安装
1.4.1 yum安装
yum install -y https://github.com/apache/apisix/releases/download/2.1/apisix-2.1-0.el7.noarch.rpm
1.4.2 启动服务
apisix start
2.apisix-dashboard安装
apisix-dashboard需要依赖go 1.13+,node 10.23.0+的版本,所以,需要提前安装好go和node。
附下载地址:
go:
https://studygolang.com/dl/golang/go1.14.13.linux-amd64.tar.gz
node:
https://npm.taobao.org/mirrors/node/v12.19.0/node-v12.19.0-linux-x64.tar.gz
2.1 安装go和node,并配置环境变量。
# go
export GOROOT=/usr/local/golang
export GOPATH=$GOROOT/workspace
export GOBIN=$GOPATH/bin
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
# node
export NODEJS_HOME=/usr/local/nodejs
export PATH=$NODEJS_HOME/bin:$PATH
2.2 使用node安装yarn。
npm install -g yarn
2.3 拉取apisix-dashboard源码,使用make build
构建。
# Clone the project
git clone https://github.com/apache/apisix-dashboard.git
2.4构建完毕,进入到output/conf
下,修改conf.yaml
配置文件,修改连接host地址,执行nohup ./manager-api &
启动服务。
conf:
listen:
host: 172.16.0.100 # `manager api` listening ip or host name
port: 9000 # `manager api` listening port
etcd:
endpoints: # supports defining multiple etcd host addresses for an etcd cluster
- 127.0.0.1:2379
网友评论