ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

apisix搭建服务apisix-dashboard安装

2022-07-06 10:33:09  阅读:275  来源: 互联网

标签:apisix sudo dashboard etcd 安装 APISIX 搭建


2022年7月5日13:34:21

注意:这里还需要注意版本的问题,建议使用比较新的版本,不然会出现api不兼容问题

官方文档:https://apisix.apache.org/zh/docs/apisix/how-to-build

vi /etc/profile
加入一行
ulimit -SHn 65536

source /etc/profile
再次查看ulimit
ulimit -n

该安装方法适用于 CentOS 7 和 CentOS 8。如果你选择该方法安装 APISIX,需要先安装 etcd。具体安装方法请参考安装 etcd。

通过 RPM 仓库安装
如果当前系统没有安装 OpenResty,请使用以下命令来安装 OpenResty 和 APISIX 仓库:
sudo yum install -y https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm

如果已安装 OpenResty 的官方 RPM 仓库,请使用以下命令安装 APISIX 的 RPM 仓库:
sudo yum-config-manager --add-repo https://repos.apiseven.com/packages/centos/apache-apisix.repo

完成上述操作后使用以下命令安装 APISIX:
sudo yum install apisix

TIP:
你也可以安装指定版本的 APISIX(本示例为 APISIX v2.13.1 LTS 版本):
sudo yum install apisix-2.13.1


apisix操作命令
# 运行以下命令初始化 NGINX 配置文件和 etcd. initialize NGINX config file and etcd
$ apisix init
 
# generate `nginx.conf` from `config.yaml` and test it
$ apisix test
 
# 启动 Apache APISIX. start Apache APISIX server
$ apisix start
 
# 其他命令
# 优雅停机 stop Apache APISIX server gracefully
$ apisix quit
 
# 强制停机 stop Apache APISIX server immediately
$ apisix stop
 
# 其他操作 more actions find by `help`
$ apisix help

rpm包的安装,就可以按照正常的方式操作

systemctl start apisix
systemctl stop apisix
systemctl status apisix


/usr/local/openresty/luajit/bin/luajit /usr/local/apisix/apisix/cli/apisix.lua start
etcd cluster version 3.3.0 is less than the required version 3.4.0, please upgrade your etcd cluster

安装etcd

ETCD_VERSION='3.4.18'

wget https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz

tar -xvf etcd-v${ETCD_VERSION}-linux-amd64.tar.gz && \
  cd etcd-v${ETCD_VERSION}-linux-amd64 && \
  sudo cp -a etcd etcdctl /usr/bin/
  
nohup etcd >/tmp/etcd.log 2>&1 &

安装apisix-dashboard
官方文档
https://github.com/apache/apisix-dashboard/blob/master/docs/en/latest/install.md

RPM包安装
sudo yum install -y https://github.com/apache/apisix-dashboard/releases/download/v2.13/apisix-dashboard-2.13-0.el7.x86_64.rpm

shell下运行
sudo manager-api -p /usr/local/apisix/dashboard/
或者以服务运行
systemctl start apisix-dashboard

Without changing the configuration, visit http://127.0.0.1:9000 to use the dashboard with GUI, where the default username and password are admin.
在不更改配置的情况下,访问 http://127.0.0.1:9000 以使用带有 GUI 的仪表板,其中默认用户名和密码为 admin。


vim /usr/local/apisix/dashboard/conf/conf.yaml

allow_list:             # If we don't set any IP list, then any IP access is allowed by default.
  #- 127.0.0.1           # The rules are checked in sequence until the first match is found.
  #- ::1
  
注释掉就可以所有ip访问


问题总结:
1,为什么不是独立安装golang lua 等组件
因为rpm包自己动处理的依赖

2,为什么会出现版本问题
因为apisix apisix-dashboard etcd 等发布版本不一致

3,ETCD建议使用rpm安装
这样重启也不会导致apisix apisix-dashboard自动启动失败



标签:apisix,sudo,dashboard,etcd,安装,APISIX,搭建
来源: https://www.cnblogs.com/zx-admin/p/16446720.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有