日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
聊聊Apisix從安裝到放棄的辛路歷程

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

目前累計(jì)服務(wù)客戶近1000家,積累了豐富的產(chǎn)品開(kāi)發(fā)及服務(wù)經(jīng)驗(yàn)。以網(wǎng)站設(shè)計(jì)水平和技術(shù)實(shí)力,樹(shù)立企業(yè)形象,為客戶提供成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站策劃、網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)絡(luò)營(yíng)銷(xiāo)、VI設(shè)計(jì)、網(wǎng)站改版、漏洞修補(bǔ)等服務(wù)。成都創(chuàng)新互聯(lián)始終以務(wù)實(shí)、誠(chéng)信為根本,不斷創(chuàng)新和提高建站品質(zhì),通過(guò)對(duì)領(lǐng)先技術(shù)的掌握、對(duì)創(chuàng)意設(shè)計(jì)的研究、對(duì)客戶形象的視覺(jué)傳遞、對(duì)應(yīng)用系統(tǒng)的結(jié)合,為客戶提供更好的一站式互聯(lián)網(wǎng)解決方案,攜手廣大客戶,共同發(fā)展進(jìn)步。

對(duì)于安裝。我本人是比較偏向于,源碼或者二進(jìn)制手動(dòng)安裝。在安裝APISIX時(shí),其他都準(zhǔn)備就緒了,就在安裝APISIX時(shí),很多代碼拉不下來(lái)。導(dǎo)致我從源碼安裝到放棄。最終選擇Docker方式

安裝etcd

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

先創(chuàng)建好配置文件。

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

復(fù)制一下內(nèi)容

# 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 & #后臺(tái)啟動(dòng)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

啟動(dòng)Docker服務(wù)

systemctl start docker

設(shè)置Docker開(kāi)機(jī)自動(dòng)啟動(dòng)

systemctl enable docker

Docker compose安裝

下載并安裝

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

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

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進(jìn)入到example目錄

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

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

接下來(lái)執(zhí)行啟動(dòng)命令docker-compose -f docker-compose-arm64.yml -p docker-apisix up -d

這樣,APISIX便搭建好了

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

創(chuàng)建APISIX服務(wù)

上游類(lèi)型可以是,固定維護(hù)的節(jié)點(diǎn)或者是服務(wù)注冊(cè)

服務(wù)注冊(cè)中心支持目前比較主流的注冊(cè)中心

這里我們選擇的是節(jié)點(diǎn)方式

這時(shí)候,我們就可以去訪問(wèn)9080端口的/web1/路徑

刷新一下頁(yè)面。請(qǐng)求會(huì)轉(zhuǎn)發(fā)到另外一個(gè)服務(wù)上

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


當(dāng)前題目:聊聊Apisix從安裝到放棄的辛路歷程
分享鏈接:http://m.5511xx.com/article/cojpsgs.html