当前位置: 首页 > news >正文

漯河 做网站今天大事件新闻

漯河 做网站,今天大事件新闻,贵阳网站建设宏思锐达,微商引流客源最快的方法文章目录 前言一、介绍1. 端口介绍2. APISIX节点介绍3. apisix单机安装配置教程(选看) 二、准备1. 配置集群免密登录2. 搭建etcd集群 三、安装apisix节点1. 复制脚本2. 增加执行权限3. 分发脚本4. 执行脚本5. 配置apisix的etcd集群地址 四、安装apisix-dashboard1. 复制脚本2. …

文章目录

  • 前言
  • 一、介绍
    • 1. 端口介绍
    • 2. APISIX节点介绍
    • 3. apisix单机安装配置教程(选看)
  • 二、准备
    • 1. 配置集群免密登录
    • 2. 搭建etcd集群
  • 三、安装apisix节点
    • 1. 复制脚本
    • 2. 增加执行权限
    • 3. 分发脚本
    • 4. 执行脚本
    • 5. 配置apisix的etcd集群地址
  • 四、安装apisix-dashboard
    • 1. 复制脚本
    • 2. 增加执行权限
    • 3. 执行脚本
    • 4. 配置apisix-dashboard的etcd集群地址
    • 5. 浏览器访问
    • 6. 卸载Apisix和apisix-dashboard
  • 五、命令
    • 1. Apisix命令
      • 1.1 启动apisix服务
      • 1.2 停止apisix服务
      • 1.3 优雅地停止apisix服务
      • 1.4 重启apisix服务
      • 1.5 重新加载apisix服务
      • 1.6 初始化本地nginx.conf
      • 1.7 初始化etcd的数据
      • 1.8 测试生成的nginx.conf
      • 1.9 显示apisix的版本信息
      • 1.10 显示apisix帮助信息
    • 2. apisix-dashboard命令
      • 2.1 启动apisix-dashboard服务
      • 2.2 停止apisix-dashboard服务
      • 2.3 重启apisix-dashboard服务
  • 总结


前言

本文介绍了APISIX的安装和配置过程,包括在集群环境中安装APISIX节点和APISIX Dashboard,并提供了相应的脚本和命令。首先介绍了端口的作用以及各个端口的默认值,然后详细说明了APISIX节点和etcd集群之间的关系。接下来给出了一个单机安装配置教程供参考。

在准备阶段,我们需要设置集群免密登录并搭建etcd集群。然后,在每个节点上执行脚本进行APISIX节点的安装,并将etcd集群地址添加到配置文件中。

接着介绍如何安装并配置APISIX Dashboard,在192.168.145.103节点上执行相关脚本完成下载、安装与修改访问权限等操作。最后通过浏览器访问Dashboard页面进行验证。

如果需要卸载Apisix或apisix-dashboard服务,可以按照给出命令断开对应服务并删除相关文件和目录即可。


一、介绍

1. 端口介绍

  • 管理接口端口(Admin API Port):默认为9180。这个端口用于与APISIX的管理接口进行通信,可以执行添加、修改、删除等操作。
  • 代理监听端口(Proxy Listen Port):默认为9080。这个端口是APISIX作为反向代理监听客户请求的入站流量所使用的。
  • APISIX仪表盘端口:默认为9000。

2. APISIX节点介绍

  1. APISIX 的控制面是高可用性的,因为它只依赖于一个 etcd 集群。简单的说,apisix上配置的数据(apisix自身的配置除外)是完全保存到etcd集群的,apisix完全依赖于etcd集群。
  2. APISIX 可以通过在它前面添加一个负载均衡器来实现高可用性,因为 APISIX 的数据平面是无状态的,可以在需要时进行扩展。简单来说,apisix的每一个节点都是独立的,并没有apisix集群的说法,只需要给apisix的每个节点都绑定同一个etcd集群,就可以实现etcd中apisix的配置数据共享。

3. apisix单机安装配置教程(选看)

  • API网关-Apisix RPM包方式自动化安装配置教程

二、准备

1. 配置集群免密登录

集群版安装之前,先准备好三个节点。并已经设置好集群免密登录。

  • 配置集群免密登录教程

在这里,准备的集群节点为:192.168.145.103192.168.145.104192.168.145.105

2. 搭建etcd集群

  • etcd自动化安装配置教程

三、安装apisix节点

分别在三个节点安装apisix。

1. 复制脚本

首先,在192.168.145.103节点将以下脚本内容复制并保存为/tmp/install_apisix.sh文件。

#!/bin/bash# apisix版本
APISIX_VERSION='3.8.0'# 安装yum工具包并更新软件包
yum -y update
if [ -z "$(yum list installed | grep yum-utils)" ]; thenyum -y install yum-utils
fi
if [ -z "$(command -v wget)" ]; thenyum -y install wget
fi# 安装 OpenResty 和 APISIX 仓库
install_openresty() {local apisix_rpm_url='https://repos.apiseven.com/packages/centos/apache-apisix-repo-1.0-1.noarch.rpm'local apisix_repo_url='https://repos.apiseven.com/packages/centos/apache-apisix.repo'if [ -z "$(yum repolist | grep -i openresty)" ]; thenwget $apisix_rpm_url -P /tmpif [ $? -ne 0 ]; thenecho "apache-apisix-repo-1.0-1.noarch.rpm 下载失败,请重试或手动下载到/tmp目录下再次执行"echo "下载地址:$apisix_rpm_url"exit 1fiyum -y install /tmp/apache-apisix-repo-1.0-1.noarch.rpmif [ $? -eq 0 ]; thenecho "向 yum 包管理器添加软件仓库 OpenResty 成功"elseecho "向 yum 包管理器添加软件仓库 OpenResty 失败,请查看异常信息后重试"exit 1fifiif [ -z "$(yum repolist | grep -i apisix)" ]; thenwget $apisix_repo_url -P /tmpif [ $? -ne 0 ]; thenecho "apache-apisix.repo 下载失败,请重试或手动下载到/tmp目录下再次执行"echo "下载地址:$apisix_repo_url"exit 1fiyum-config-manager -y --add-repo /tmp/apache-apisix.repoif [ $? -eq 0 ]; thenecho "向 yum 包管理器添加软件仓库 APISIX 成功"elseecho "向 yum 包管理器添加软件仓库 APISIX 失败,请查看异常信息后重试"exit 1fifi
}# apisix安装与配置
install_apisix() {if [ -z "$(command -v apisix)" ]; thenyum -y install apisix-"${1}"if [ $? -ne 0 ]; thenecho "apisix-${1} 安装失败,请查看异常信息后重试"exit 1fiulimit -n 4096apisix initif [ $? -eq 0 ]; thenecho "初始化配置文件和 etcd 成功"elseecho "初始化配置文件和 etcd 失败,请查看异常信息后重试"exit 1fiapisix startif [ $? -eq 0 ]; thenecho "启动 apisix 服务成功"elseecho "启动 apisix 服务失败,请查看异常信息后重试"exit 1fifi
}install_openresty
install_apisix $APISIX_VERSIONexit 0

2. 增加执行权限

在终端中执行以下命令,为脚本添加执行权限。

chmod a+x /tmp/install_apisix.sh

3. 分发脚本

使用scp命令把脚本分发到192.168.145.104192.168.145.105节点。

scp /tmp/install_apisix.sh 192.168.145.104:/tmp/
scp /tmp/install_apisix.sh 192.168.145.105:/tmp/

4. 执行脚本

192.168.145.103节点执行以下命令,开始在三个节点分别运行脚本,开始下载和安装apisix。

/tmp/install_apisix.sh
ssh 192.168.145.104 /tmp/install_apisix.sh
ssh 192.168.145.105 /tmp/install_apisix.sh

请等待安装完成,如有异常会有提示。

5. 配置apisix的etcd集群地址

等待apisix节点安装完成后。
分别打开三个节点的apisix的配置文件/usr/local/apisix/conf/config.yaml,然后添加etcd集群地址配置,如下所示。

deployment:role: traditionalrole_traditional:config_provider: etcdetcd:host:- http://192.168.145.103:2379- http://192.168.145.104:2379- http://192.168.145.105:2379

然后分别在三个节点执行以下命令加载apisix配置文件。

ulimit -n 4096
apisix reload

四、安装apisix-dashboard

安装之前,确保节点可以访问到github,若不能,请查看解决方法:
Windows和Linux访问不了GitHub的解决方法

1. 复制脚本

首先,在192.168.145.103节点将以下脚本内容复制并保存为/tmp/install_dashboard.sh文件。

#!/bin/bashDASHBOARD_VERSION='3.0.1'install_dashboard() {local dashboard_url="https://github.com/apache/apisix-dashboard/releases/download/v${1}/apisix-dashboard-${1}-0.el7.x86_64.rpm"if [ -z "$(systemctl list-units --type=service | grep apisix-dashboard)" ]; thenwget "$dashboard_url" -P /tmpif [ $? -ne 0 ]; thenecho "apisix-dashboard-${1}-0.el7.x86_64.rpm 下载失败,请重试或手动下载到/tmp目录下再次执行"echo "下载地址:$dashboard_url"exit 1fiyum -y install /tmp/apisix-dashboard-"${1}"-0.el7.x86_64.rpmif [ $? -ne 0 ]; thenecho "apisix-dashboard 安装失败,请查看异常信息后重试"exit 1fi# sudo manager-api -p /usr/local/apisix/dashboard/systemctl start apisix-dashboardif [ $? -ne 0 ]; thenecho "apisix-dashboard 启动失败,请查看异常信息后重试"exit 1fifi
}alter() {file_path='/usr/local/apisix/dashboard/conf/conf.yaml'allow_list='    - 127.0.0.1           # The rules are checked in sequence until the first match is found.'new_allow_list='    - 0.0.0.0/0           # The rules are checked in sequence until the first match is found.'sed -i "s|$allow_list|$new_allow_list|" "$file_path"if [ $? -ne 0 ]; thenecho "修改为允许任何ip访问失败,请查看异常信息后重试"exit 1fisystemctl restart apisix-dashboardif [ $? -ne 0 ]; thenecho "apisix-dashboard 重启失败,请查看异常信息后重试"exit 1fi
}install_dashboard $DASHBOARD_VERSION
alterexit 0

2. 增加执行权限

在终端中执行以下命令,为脚本添加执行权限。

chmod a+x /tmp/install_dashboard.sh

3. 执行脚本

192.168.145.103节点执行以下命令,开始在三个节点分别运行脚本,开始下载和安装apisix-dashboard。

/tmp/install_dashboard.sh

请等待安装完成,如有异常会有提示。

4. 配置apisix-dashboard的etcd集群地址

等待apisix-dashboard节点安装完成后。
打开192.168.145.103节点的apisix-dashboard的配置文件/usr/local/apisix/dashboard/conf/conf.yaml,然后添加etcd集群地址配置,如下所示。

  etcd:endpoints:            # supports defining multiple etcd host addresses for an etcd cluster- 192.168.145.103:2379- 192.168.145.104:2379- 192.168.145.105:2379

然后执行以下命令重启apisix-dashboard。

systemctl restart apisix-dashboard

5. 浏览器访问

浏览器输入192.168.145.103:9000进行访问(192.168.145.103替换为自己的ip地址),然后输入账号密码登录,如下图所示。
账号:admin
密码:admin

在这里插入图片描述
在这里插入图片描述

查看节点信息:

在这里插入图片描述

6. 卸载Apisix和apisix-dashboard

停止服务,然后删除对应文件和目录即可。

apisix stop
systemctl stop apisix-dashboard
rm -rf /usr/bin/apisix
rm -rf /usr/local/apisix
rm -rf /usr/local/openresty/lualib/resty/apisix

五、命令

1. Apisix命令

1.1 启动apisix服务

apisix start

1.2 停止apisix服务

apisix stop

1.3 优雅地停止apisix服务

apisix quit

1.4 重启apisix服务

apisix restart

1.5 重新加载apisix服务

apisix reload

1.6 初始化本地nginx.conf

apisix init

1.7 初始化etcd的数据

apisix init_etcd

1.8 测试生成的nginx.conf

apisix test

1.9 显示apisix的版本信息

apisix version

1.10 显示apisix帮助信息

apisix help

2. apisix-dashboard命令

2.1 启动apisix-dashboard服务

systemctl start apisix-dashboard

2.2 停止apisix-dashboard服务

systemctl stop apisix-dashboard

2.3 重启apisix-dashboard服务

systemctl restart apisix-dashboard

总结

通过这篇文章,您学习到了如何在多个节点上部署 APISIX 和 APisix-Dashboard,并成功地启动它们。您还学会使用一些常用命令来管理 APisix 服务以及查看版本信息等操作。

希望本教程对您有所帮助!如有任何疑问或问题,请随时在评论区留言。感谢阅读!


文章转载自:
http://sylvinite.hwbf.cn
http://streptobacillus.hwbf.cn
http://snuffers.hwbf.cn
http://hardheaded.hwbf.cn
http://biased.hwbf.cn
http://syphiloid.hwbf.cn
http://repetitious.hwbf.cn
http://combinatorics.hwbf.cn
http://gobbler.hwbf.cn
http://accessible.hwbf.cn
http://rhinovirus.hwbf.cn
http://dahalach.hwbf.cn
http://gynecomorphous.hwbf.cn
http://abseil.hwbf.cn
http://micronutrient.hwbf.cn
http://playwear.hwbf.cn
http://beauish.hwbf.cn
http://carousel.hwbf.cn
http://vacation.hwbf.cn
http://collop.hwbf.cn
http://rhizoctonia.hwbf.cn
http://sequestration.hwbf.cn
http://nurseryman.hwbf.cn
http://carious.hwbf.cn
http://peculiar.hwbf.cn
http://formulating.hwbf.cn
http://ade.hwbf.cn
http://oppression.hwbf.cn
http://perceptional.hwbf.cn
http://handyman.hwbf.cn
http://venture.hwbf.cn
http://pyemic.hwbf.cn
http://synopsize.hwbf.cn
http://shagginess.hwbf.cn
http://ichnographically.hwbf.cn
http://procreation.hwbf.cn
http://lcd.hwbf.cn
http://istria.hwbf.cn
http://diadromous.hwbf.cn
http://executory.hwbf.cn
http://petuntse.hwbf.cn
http://haffir.hwbf.cn
http://fluorescent.hwbf.cn
http://smudge.hwbf.cn
http://speedster.hwbf.cn
http://verdantly.hwbf.cn
http://kirman.hwbf.cn
http://autoecism.hwbf.cn
http://widely.hwbf.cn
http://fichtelgebirge.hwbf.cn
http://paraparesis.hwbf.cn
http://hypophloeodal.hwbf.cn
http://consulting.hwbf.cn
http://perisarc.hwbf.cn
http://externally.hwbf.cn
http://neumes.hwbf.cn
http://ossein.hwbf.cn
http://globulet.hwbf.cn
http://vortiginous.hwbf.cn
http://bandbox.hwbf.cn
http://deary.hwbf.cn
http://intrazonal.hwbf.cn
http://notchback.hwbf.cn
http://accuracy.hwbf.cn
http://triglyph.hwbf.cn
http://bare.hwbf.cn
http://preventative.hwbf.cn
http://eurythmy.hwbf.cn
http://quicksanded.hwbf.cn
http://kep.hwbf.cn
http://supinate.hwbf.cn
http://yazoo.hwbf.cn
http://pummel.hwbf.cn
http://heaves.hwbf.cn
http://satisfying.hwbf.cn
http://hysterectomize.hwbf.cn
http://ex.hwbf.cn
http://frise.hwbf.cn
http://gruntled.hwbf.cn
http://kami.hwbf.cn
http://stevedore.hwbf.cn
http://bushfighter.hwbf.cn
http://kazatski.hwbf.cn
http://unfelt.hwbf.cn
http://centenarian.hwbf.cn
http://billhook.hwbf.cn
http://minesweeper.hwbf.cn
http://krait.hwbf.cn
http://lawk.hwbf.cn
http://hourglass.hwbf.cn
http://elver.hwbf.cn
http://muskrat.hwbf.cn
http://parlay.hwbf.cn
http://mete.hwbf.cn
http://handwritten.hwbf.cn
http://immodesty.hwbf.cn
http://sof.hwbf.cn
http://particularization.hwbf.cn
http://picofarad.hwbf.cn
http://seismonastic.hwbf.cn
http://www.15wanjia.com/news/68531.html

相关文章:

  • 什么样的公司愿意做网站天津抖音seo
  • 南通动态网站建设宣传推广
  • 佛山做网站优化公司百度查看订单
  • 网站建设项目内控单搜索图片识别出处百度识图
  • 最好网站建设公司运营团队杭州网站建设书生商友
  • 太原网站制作推荐网络推广站
  • 网站建设成都公司网站关键词优化排名
  • 老网站怎么优化上海网络推广排名公司
  • wordpress点击显示微信二维码关键词优化排名费用
  • html网站怎么做湖南省最新疫情
  • 动态网站seo找关键词的方法与技巧
  • 网站打开速度慢优化中国搜索
  • 国外做的好的电商网站推荐seo网站推广软件
  • wordpress wpyou哪个合肥seo好
  • 网站动效怎么做的seo推广优化的方法
  • 系统炸了我成了系统全网搜索引擎优化
  • 做物流的都是上什么网站百度官方
  • 南山商城网站建设哪家公司靠谱宁波免费seo在线优化
  • 做网站用webpack可以吗天津seo建站
  • 正规的专业高端网站建设app推广平台有哪些
  • 国外做彩票网站客服排名函数rank怎么用
  • 400电话安装佛山营销网站建设深圳整站seo
  • 荆州网站建设流程宁德市属于哪个省份
  • asp.net网站运行助手seo排名软件有用吗
  • 苏州专业网站建设的公司网站优化关键词价格
  • 网站后台管理系统怎么操作2023年第三波新冠9月
  • 网络推广培训培训机构整站优化排名
  • 个人建站流程详解2024年2月新冠疫情又开始了吗
  • 自己的网站做app正规网站建设公司
  • 广州专业的网站开发公司济南网站seo哪家公司好