Cluster Deployment
Before you read this document, you need to complete some preparations before deploying Shenyu according to the Deployment Prerequisites document.
This aritcle introduces how to delopy the Shenyu gateway in cluster enviroment.
In this part, you can see ShenYu Binary Packages Deployment before deploying.
Enviromental Preparation#
- Two or more Gateway Boostrap servers, these servers must install JDK1.8+.
- A server for Gateway Admin, this server must install mysql/pgsql/h2 and JDK1.8+.
- A server for nginx.
Start Apache ShenYu Admin#
download and unzip apache-shenyu-incubating-2.4.3-admin-bin.tar.gz in your Gateway Admin server.
config your database, go to the
/confdirectory, and modifyspring.profiles.activeof the configuration inapplication.yamltomysql,pgorh2.config your way of synchronization, go to the
/confdirectory, and modifyshenyu.syncof configuration inapplication.yamltowebsocket,http,zookeeper,etcd,consulornacos.start Apache ShenYu Admin in
bindirectory.
> windows: start.bat
> linux: ./start.sh Start Apache ShenYu Boostrap#
download and unzip apache-shenyu-incubating-2.4.3-bootstrap-bin.tar.gz in your Gateway Boostrap server.
config your synchronization, go to the
/confdirectory, and modifyshenyu.syncof configuration inapplication.yamltowebsocket,http,zookeeper,etcd,consulornacos, this configuaration must remain the same ofShenyYu Admin.repeat above-mentioned operations in each
ShenYu Bootstrapserver.start Apache ShenYu Bootstrap in
bindirectory.
> windwos : start.bat
> linux : ./start.sh After completing these operations, you will deploy
ShenYu BoostrapCluster.For example. you will deploy
ShenYu Bootstrapin10.1.1.1and10.1.1.2and deploy nginx in10.1.1.3.
Start Nginx#
download and install
nginx.modify
upstreamandserverof configuration innginx.conf.
upstream shenyu_gateway_cluster { ip_hash; server 10.1.1.1:9195 max_fails=3 fail_timeout=10s weight=50; server 10.1.1.2:9195 max_fails=3 fail_timeout=10s weight=50;}server { location / { proxy_pass http://shenyu_gateway_cluster; proxy_set_header HOST $host; proxy_read_timeout 10s; proxy_connect_timeout 10s; }}- start nginx.
> windows: ./nginx.exe
> linux: /usr/local/nginx/sbin/nginx - verify nginx, looking at your
ShenYu Bootstraplog orNginxlog, Where will the verification request go.