安装依赖:
# install epel, `luarocks` need it.
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
# add OpenResty source
sudo yum install yum-utils
sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
# install OpenResty, etcd and some compilation tools
sudo yum install -y etcd openresty curl git gcc luarocks lua-devel
# start etcd server
sudo service etcd start
安装apisix
-
下载apisix安装包:
wget http://www.apache.org/dist/incubator/apisix/1.1/apache-apisix-1.1-incubating-src.tar.gz tar zxvf apache-apisix-1.1-incubating-src.tar.gz -
安装运行时依赖的 Lua 库:
cd apache-apisix-1.1-incubating make deps -
将安装文件拷贝到/usr/local/apisix目录下
make install copy -r deps /usr/local/apisix/
安装dashboard
-
下载apisix的dashboard
git clone https://github.com/apache/incubator-apisix-dashboard.git -
安装yarn
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo sudo yum install yarn -
安装nodejs
-
下载nodejs:
cdn.npm.taobao.org/dist/node/v… -
解压目录:
tar -xvf node-v12.16.1-linux-x64.tar.xz -
将目录加入到PATH环境变量中
-
build dashboard
git checkout v1.0 yarn && yarn build:prod -
拷贝dashboard到apisix的安装目录
mkdir -p /usr/local/apisix/dashboard cp -r dist/* /usr/local/apisix/dashboard
-
启动apisix并验证
-
启动
apisix start -
验证
在浏览器中输入http://ip:9080/apisix/dashboard
出现如下页面,证明安装成功