apisix安装

2021-03-04  本文已影响0人  dozenx

apisix 搭建

1找一台干净的linux主机

192.168.212.52 非docker 安装

192.168.212.53 docker 安装

2打开github官网

https://github.com/apache/apisix/ 下找到 Get Started (官网一直在变动)

3打开

$ mkdir apisix-2.3
$ wget https://downloads.apache.org/apisix/2.3/apache-apisix-2.3-src.tgz
$ tar zxvf apache-apisix-2.3-src.tgz -C apisix-2.3
$ make deps
./bin/apisix version

方式1 源码安装

参考 https://github.com/apache/apisix/

1 安装依赖

https://github.com/apache/apisix/blob/master/docs/en/latest/install-dependencies.md

# install 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 && \
    sudo cp -a etcd etcdctl /usr/bin/

# add OpenResty source
sudo yum install yum-utils
sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo

# install OpenResty and some compilation tools
sudo yum install -y openresty curl git gcc openresty-openssl111-devel unzip

# install LuaRocks
curl https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh -sL | bash -

# start etcd server
nohup etcd &

2 安装apisix

https://github.com/apache/apisix/

下载源码

$ mkdir apisix-2.3
$ wget https://downloads.apache.org/apisix/2.3/apache-apisix-2.3-src.tgz
$ tar zxvf apache-apisix-2.3-src.tgz -C apisix-2.3

安装依赖包

$ make deps

检查版本

$ ./bin/apisix version

启动服务

$ ./bin/apisix start

3 开始安装dashboard

https://github.com/apache/apisix-dashboard

https://github.com/apache/apisix-dashboard/blob/master/docs/en/latest/deploy.md

web依赖安装

node安装

https://nodejs.org/en/download/

yarn 安装

https://yarnpkg.com/getting-started/install

克隆工程

git clone -b v2.4 https://github.com/apache/apisix-dashboard.git

编译

cd apisix-dashboard
make build

启动服务

cd output
./manager-api
nohup ./manager-api &

测试

http://127.0.0.1:9000/

如果要让外网访问的话

修改con f/config.yaml文件

修改listen 端口 为0.0.0.0:9000

修改allow ip 加上你自己的IP地址

dashboard 的操作流程说明

https://blog.csdn.net/weixin_44096325/article/details/110230011
修改

方法2 docker安装

docker pull apache/apisix

Using default tag: latest
latest: Pulling from apache/apisix
2d473b07cdd5: Already exists
c38b9dde23fa: Pulling fs layer
error pulling image configuration: Get https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/2e/2e23803ac6a3de8bf4c90b4ecd9e71a26086d9154491642194a1fec98effeb09/data?verify=1614764252-rxisgpbyp7YT5Uud0N3Dc4fkAx8%3D: dial tcp 104.18.122.25:443: i/o timeout

好像之前有存续的任务

但是上次没成功

还是踏踏实实走源码

上一篇下一篇

猜你喜欢

热点阅读