diff --git a/demos/nginx-1.14.0/conf/demos/demo01.conf b/demos/nginx-1.14.0/conf/demos/demo01.conf index b6392b8..7e42436 100644 --- a/demos/nginx-1.14.0/conf/demos/demo01.conf +++ b/demos/nginx-1.14.0/conf/demos/demo01.conf @@ -1,5 +1,5 @@ upstream demo01-server { - server 127.0.0.1:9001; + server 127.0.0.1:9010; } server { diff --git a/demos/nginx-1.14.0/conf/demos/demo02.conf b/demos/nginx-1.14.0/conf/demos/demo02.conf index d8fc9ea..ebd82ab 100644 --- a/demos/nginx-1.14.0/conf/demos/demo02.conf +++ b/demos/nginx-1.14.0/conf/demos/demo02.conf @@ -1,9 +1,9 @@ #设定负载均衡的服务器列表 upstream demo02-server { # weigth参数表示权值,权值越高被分配到的几率越大 - server 127.0.0.1:9011 weight=5; - server 127.0.0.1:9012 weight=1; - server 127.0.0.1:9013 weight=6; + server 127.0.0.1:9021 weight=5; + server 127.0.0.1:9022 weight=1; + server 127.0.0.1:9023 weight=6; } server { diff --git a/demos/scripts/demo01-start.bat b/demos/scripts/demo01-start.bat index 19f15b9..09b3799 100644 --- a/demos/scripts/demo01-start.bat +++ b/demos/scripts/demo01-start.bat @@ -1,16 +1,16 @@ rem ------------------------------------------------- rem 启动 Demo1 rem 1. 启动 Nginx -rem 2. 启动一个 JavaApp,访问地址为:localhost:9001 +rem 2. 启动一个 JavaApp,访问地址为:localhost:9010 rem ------------------------------------------------- @echo off echo ">>>> 1. Start nginx" cd "../nginx-1.14.0" call nginx-start.bat -echo ">>>> 2. Start javaapp - localhost:9001" +echo ">>>> 2. Start javaapp - localhost:9010" cd "../javaapp" -java -Dtomcat.connector.port=9001 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main +java -Dtomcat.connector.port=9010 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main pause diff --git a/demos/scripts/demo02-start.bat b/demos/scripts/demo02-start.bat index badada6..2f26849 100644 --- a/demos/scripts/demo02-start.bat +++ b/demos/scripts/demo02-start.bat @@ -2,20 +2,20 @@ rem ---------------------------------------------------------------------------- rem Demo02 - 负载均衡配置(Nginx/demos/nginx-1.14.0/conf/demos/demo02.conf) rem 1. 启动 Nginx rem 2. 启动三个 JavaApp,访问地址分别为: -rem localhost:9011 -rem localhost:9012 -rem localhost:9013 +rem localhost:9021 +rem localhost:9022 +rem localhost:9023 rem ----------------------------------------------------------------------------- @echo off echo ">>>> 1. Start nginx" cd "../nginx-1.14.0" call nginx-start.bat -echo ">>>> 2. Start 3 java app: localhost:9011/localhost:9012/localhost:9013" +echo ">>>> 2. Start 3 java app: localhost:9021, localhost:9022, localhost:9023" cd "../javaapp" -start /min java -Dtomcat.connector.port=9011 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main -start /min java -Dtomcat.connector.port=9012 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main -start /min java -Dtomcat.connector.port=9013 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main +start /min java -Dtomcat.connector.port=9021 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main +start /min java -Dtomcat.connector.port=9022 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main +start /min java -Dtomcat.connector.port=9023 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main pause diff --git a/demos/scripts/demo03-start.bat b/demos/scripts/demo03-start.bat index 483fa8e..6cfd2d0 100644 --- a/demos/scripts/demo03-start.bat +++ b/demos/scripts/demo03-start.bat @@ -3,15 +3,15 @@ rem Demo03 - 网站有多个 webapp 的配置(Nginx/demos/nginx-1.14.0/conf/d rem 1. 启动 Nginx rem 2. 启动三个 JavaApp,访问地址分别为: rem localhost:9030/ -rem localhost:9032/product -rem localhost:9033/user +rem localhost:9031/product +rem localhost:9032/user rem ----------------------------------------------------------------------------- @echo off echo ">>>> 1. Start nginx" cd "../nginx-1.14.0" call nginx-start.bat -echo ">>>> 2. Start 3 java app: localhost:9030、localhost:9031/product、localhost:9032/user" +echo ">>>> 2. Start 3 java app: localhost:9030, localhost:9031/product, localhost:9032/user" cd "../javaapp" start /min java -Dtomcat.connector.port=9030 -Dtomcat.context.path=/ -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main start /min java -Dtomcat.connector.port=9031 -Dtomcat.context.path=/product -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.app.Main