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 Admindownload and unzip apache-shenyu-incubating-2.4.3-admin-bin.tar.gz in your Gateway Admin server.
config your database, go to the
/conf
directory, and modifyspring.profiles.active
of the configuration inapplication.yaml
tomysql
,pg
orh2
.config your way of synchronization, go to the
/conf
directory, and modifyshenyu.sync
of configuration inapplication.yaml
towebsocket
,http
,zookeeper
,etcd
,consul
ornacos
.start Apache ShenYu Admin in
bin
directory.
> windows: start.bat
> linux: ./start.sh
#
Start Apache ShenYu Boostrapdownload and unzip apache-shenyu-incubating-2.4.3-bootstrap-bin.tar.gz in your Gateway Boostrap server.
config your synchronization, go to the
/conf
directory, and modifyshenyu.sync
of configuration inapplication.yaml
towebsocket
,http
,zookeeper
,etcd
,consul
ornacos
, this configuaration must remain the same ofShenyYu Admin
.repeat above-mentioned operations in each
ShenYu Bootstrap
server.start Apache ShenYu Bootstrap in
bin
directory.
> windwos : start.bat
> linux : ./start.sh
After completing these operations, you will deploy
ShenYu Boostrap
Cluster.For example. you will deploy
ShenYu Bootstrap
in10.1.1.1
and10.1.1.2
and deploy nginx in10.1.1.3
.
#
Start Nginxdownload and install
nginx
.modify
upstream
andserver
of 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 Bootstrap
log orNginx
log, Where will the verification request go.