成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

聊聊Apisix從安裝到放棄的辛路歷程

開發 項目管理
對于安裝。我本人是比較偏向于,源碼或者二進制手動安裝。在安裝APISIX時,其他都準備就緒了,就在安裝APISIX時,很多代碼拉不下來。導致我從源碼安裝到放棄。最終選擇Docker方式。

?最近,有幾個老項目需要做一些限流、安全、灰度發布等這些方面的升級。由于項目中也一直在用Nginx做請求轉發。所以在在OpenResty,Kong、APISIX三者之間初步對比了一下。從性能、功能和易用性的角度考慮,最終初步選擇APISIX這玩意。

對于安裝。我本人是比較偏向于,源碼或者二進制手動安裝。在安裝APISIX時,其他都準備就緒了,就在安裝APISIX時,很多代碼拉不下來。導致我從源碼安裝到放棄。最終選擇Docker方式

安裝etcd

去Githubhttps://github.com/etcd-io/etcd/releases/下載編譯好的二進制.

先創建好配置文件。

mkdir -p /etc/etcd/
cd /etc/etcd/
vim etcd.yaml

復制一下內容

# This is the configuration file for the etcd server.

# Human-readable name for this member.
name: 'etcd1'

# Path to the data directory.
data-dir:

# Path to the dedicated wal directory.
wal-dir:

# Number of committed transactions to trigger a snapshot to disk.
snapshot-count: 10000

# Time (in milliseconds) of a heartbeat interval.
heartbeat-interval: 100

# Time (in milliseconds) for an election to timeout.
election-timeout: 1000

# Raise alarms when backend size exceeds the given quota. 0 means use the
# default quota.
quota-backend-bytes: 0

# List of comma separated URLs to listen on for peer traffic.
listen-peer-urls: http://172.31.79.250:2380

# List of comma separated URLs to listen on for client traffic.
listen-client-urls: http://172.31.79.250:2379

# Maximum number of snapshot files to retain (0 is unlimited).
max-snapshots: 5

# Maximum number of wal files to retain (0 is unlimited).
max-wals: 5

# Comma-separated white list of origins for CORS (cross-origin resource sharing).
cors:

# List of this member's peer URLs to advertise to the rest of the cluster.
# The URLs needed to be a comma-separated list.
initial-advertise-peer-urls: http://172.31.79.250:2380

# List of this member's client URLs to advertise to the public.
# The URLs needed to be a comma-separated list.
advertise-client-urls: http://172.31.79.250:2379

# Discovery URL used to bootstrap the cluster.
discovery:

# Valid values include 'exit', 'proxy'
discovery-fallback: 'proxy'

# HTTP proxy to use for traffic to discovery service.
discovery-proxy:

# DNS domain used to bootstrap initial cluster.
discovery-srv:

# Initial cluster configuration for bootstrapping.
initial-cluster:

# Initial cluster token for the etcd cluster during bootstrap.
initial-cluster-token: 'etcd-cluster'

# Initial cluster state ('new' or 'existing').
initial-cluster-state: 'new'

# Reject reconfiguration requests that would cause quorum loss.
strict-reconfig-check: false

# Enable runtime profiling data via HTTP server
enable-pprof: true

# Valid values include 'on', 'readonly', 'off'
proxy: 'off'

# Time (in milliseconds) an endpoint will be held in a failed state.
proxy-failure-wait: 5000

# Time (in milliseconds) of the endpoints refresh interval.
proxy-refresh-interval: 30000

# Time (in milliseconds) for a dial to timeout.
proxy-dial-timeout: 1000

# Time (in milliseconds) for a write to timeout.
proxy-write-timeout: 5000

# Time (in milliseconds) for a read to timeout.
proxy-read-timeout: 0

client-transport-security:
# Path to the client server TLS cert file.
cert-file:

# Path to the client server TLS key file.
key-file:

# Enable client cert authentication.
client-cert-auth: false

# Path to the client server TLS trusted CA cert file.
trusted-ca-file:

# Client TLS using generated certificates
auto-tls: false

peer-transport-security:
# Path to the peer server TLS cert file.
cert-file:

# Path to the peer server TLS key file.
key-file:

# Enable peer client cert authentication.
client-cert-auth: false

# Path to the peer server TLS trusted CA cert file.
trusted-ca-file:

# Peer TLS using generated certificates.
auto-tls: false

# The validity period of the self-signed certificate, the unit is year.
self-signed-cert-validity: 1

# Enable debug-level logging for etcd.
log-level: debug

logger: zap

# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
log-outputs: [stderr]

# Force to create a new one member cluster.
force-new-cluster: false

auto-compaction-mode: periodic
auto-compaction-retention: "1"
wget https://github.com/etcd-io/etcd/releases/download/v3.5.7/etcd-v3.5.7-linux-amd64.tar.gz
tar -xvf etcd-v3.5.7-linux-amd64.tar.gz
cd etcd-v3.5.7-linux-amd64
cp -a etcd etcdctl /usr/bin/
nohup etcd --config-file /etc/etcd/etcd.yaml >/tmp/etcd.log 2>&1 & #后臺啟動etcd

安裝Docker

添加阿里鏡像源

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安裝Docker

yum install docker-ce docker-ce-cli containerd.io

啟動Docker服務

systemctl start docker

設置Docker開機自動啟動

systemctl enable docker

Docker compose安裝

下載并安裝

curl -SL https://github.com/docker/compose/releases/download/v2

上面這個地址非常慢,有時候直接連不通,具體原因,大家肯定都知道。所以下載用國內的鏡像地址吧

sudo curl -L https://get.daocloud.io/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

去下載源碼https://github.com/apache/apisix-docker.git。cd apisix-docker/example進入到example目錄

由于etcd我是以二進制方式安裝,那么apisix_conf和dashboard_conf里面的etcd配置信息改為實際地址和端口。

etcd:
host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster.
- "http://172.31.79.250:2379" # multiple etcd address
prefix: "/apisix" # apisix configurations prefix
timeout: 30 # 30 seconds

另外docker-compose-arm64.yml里面的ETCD去掉,再去掉depends_on,刪除下面這段

depends_on:
- etcd

接下來執行啟動命令docker-compose -f docker-compose-arm64.yml -p docker-apisix up -d

這樣,APISIX便搭建好了

我們使用dashboard_conf文件夾中conf.yaml文件里的users屬性來登錄APISIX.

創建APISIX服務

上游類型可以是,固定維護的節點或者是服務注冊

服務注冊中心支持目前比較主流的注冊中心

這里我們選擇的是節點方式

這時候,我們就可以去訪問9080端口的/web1/路徑

刷新一下頁面。請求會轉發到另外一個服務上

APISIX初步安裝完成,基本功能我們可以基于web UI界面配置完成,還可以借助插件來保護我們的服務,讓服務更加穩定、安全。接下來就是進一步的探究APISIX提供的插件。

責任編輯:武曉燕 來源: 今日頭條
相關推薦

2022-01-19 22:14:36

Apache APIAPI 網關插件

2021-05-18 06:11:55

QtUbuntuC++

2021-05-20 07:47:49

數據庫MySQL 數據庫安裝

2010-04-21 13:30:24

Linux rpm命令

2022-12-05 16:45:57

模型方法

2022-11-22 14:39:40

CPU單核多核

2023-02-10 09:34:42

人工智能駕駛

2023-12-15 09:57:13

微服務鏈路服務

2019-07-02 14:17:18

API網關網關流量

2012-03-19 21:06:52

Android

2017-05-23 16:36:06

程序程序員

2024-04-26 08:17:09

GoGoogle項目

2022-07-01 08:26:22

區塊鏈去中心化以太坊

2024-12-30 09:55:44

2025-04-22 02:00:00

芯片晶圓光刻機

2022-11-01 12:16:47

Nginx微服務編譯

2017-07-10 14:20:45

2017-03-25 20:30:15

2020-03-25 09:57:29

Python數據工具

2021-09-01 22:58:22

Canvas標簽
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 成人免费视频 | 网址黄| jlzzjlzz国产精品久久 | 女人毛片a毛片久久人人 | 香蕉一区二区 | 国产一区二区自拍 | 亚洲高清在线免费观看 | 亚洲天堂男人的天堂 | 午夜精品一区二区三区在线视频 | 免费激情 | 羞羞视频在线观免费观看 | 一区二区在线免费观看 | 中文字幕日韩欧美一区二区三区 | 免费亚洲一区二区 | 国产精品久久久久久中文字 | 青青草av| 日韩三级在线 | 亚洲国产成人精品久久 | 成人网在线看 | 日本三级网| 免费看a | 中文字幕在线观看日韩 | 欧美一级视频在线观看 | 性高湖久久久久久久久3小时 | 欧美一级片在线观看 | 国产精品久久久久久福利一牛影视 | 久久精品日产第一区二区三区 | 免费在线观看一区二区 | 亚洲性人人天天夜夜摸 | 亚洲精品一区二区另类图片 | 免费99精品国产自在在线 | 欧美一级精品片在线看 | 中文字幕av网站 | 成人精品鲁一区一区二区 | 日韩视频中文字幕 | 国产精品久久久久av | 久久久久国产视频 | 中文字幕一区二区三区在线观看 | 99在线播放 | 一区二区三区四区电影视频在线观看 | 一级做a爰片性色毛片16美国 |