Fabio(Go 語言): "https://github.com/eBay/fabio" Fabio 是一個快速、現代、zero conf 負載均衡 HTTP(S) 路由器,用於部署 Consul 管理的微服務。 Fabio 由 eBay Classifieds Group 開發,用於處理 mar ...
Fabio(Go 語言):https://github.com/eBay/fabio
Fabio 是一個快速、現代、zero-conf 負載均衡 HTTP(S) 路由器,用於部署 Consul 管理的微服務。
Fabio 由 eBay Classifieds Group 開發,用於處理 marktplaats.nl 和 kijiji.it 的流量。Marktplaats 所有的流量都經過 Fabio ,每秒有 250000 個請求,分發於數個 Fabio 實例,並且沒有出現任何延遲。
簡單流程圖(摘自 http://dockone.io/article/1567):
====== 服務註冊 ========= =========
A服務 <------> consul集群 ----> 健康的 A/不健康的 A 集群
====== 健康檢查 ========= =========
^
| 加入/移出路由表
|
========
fabio 集群
========
|
| A服務 如果找到則成功路由否則返回錯誤
V
http 請求
Mac OS 安裝命令(如果沒有安裝 Consul,會自動安裝):
$ brew install fabio
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
crystal-icr [email protected] gnome-autoar libchaos [email protected] pdftoipe [email protected]
dbt gcc@5 [email protected] libswiftnav mps-youtube recipes ucg
[email protected] gcc@6 lasso [email protected] ndenv servus
==> Updated Formulae
afflib dnscrypt-proxy handbrake mpv sassc
ant doxygen hebcal mysql sbcl
antigen duply highlight mysql-connector-c++ sqldiff
antlr flex hugo mysql-sandbox sqlite
apache-spark fluent-bit imagemagick nagios sqlite-analyzer
arangodb fobis ipv6calc nagios-plugins stunnel
astyle fontforge jasper ncdc syncthing
ats2-postiats fpp jenkins ncftp tarantool
aws-sdk-cpp freetype lean-cli neo4j taylor
awscli ganglia leptonica nvm tile38
bup gcc libass ooniprobe vim
cdiff [email protected] libgit2 opentsdb volatility
cfr-decompiler geos libgit2-glib osm2pgsql vowpal-wabbit
checkstyle git-annex libpng osquery weechat
cloog git-lfs libxml2 pngpaste wine
compcert gitg lmdb poco winetricks
couchdb gitless m-cli pure-ftpd wireguard-tools
cppcheck gmic macosvpn qt5 x265
czmq gnome-builder menhir questdb yaz
dbhash gnutls mg rclone youtube-dl
dmd groonga mitmproxy re2
==> Deleted Formulae
[email protected] qt tutum
Error: Could not link:
/usr/local/share/man/man1/brew.1
Please delete these paths and run `brew update`.
==> Installing dependencies for fabio: consul
==> Installing fabio dependency: consul
==> Downloading https://homebrew.bintray.com/bottles/consul-0.7.2.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring consul-0.7.2.sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/consul
Target /usr/local/bin/consul
already exists. You may want to remove it:
rm '/usr/local/bin/consul'
To force the link and overwrite all conflicting files:
brew link --overwrite consul
To list all files that would be deleted:
brew link --overwrite --dry-run consul
Possible conflicting files are:
/usr/local/bin/consul
==> Caveats
If consul was built with --with-web-ui, you can activate the UI by running
consul with `-ui-dir /usr/local/Cellar/consul/0.7.2/share/consul/web-ui`.
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
To have launchd start consul now and restart at login:
brew services start consul
Or, if you don't want/need a background service you can just run:
consul agent -dev -advertise 127.0.0.1
==> Summary