This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git
commit 341010a90c8b15ec28ed7a384ca75858b2a90a28 Author: chinx <[email protected]> AuthorDate: Mon Nov 18 19:45:36 2019 +0800 Fix the problem of page layout --- _syncer/cn/multi-servicecenters.md | 87 ++++++++++++++++++----------------- _syncer/multi-servicecenters.md | 92 +++++++++++++++++--------------------- 2 files changed, 85 insertions(+), 94 deletions(-) diff --git a/_syncer/cn/multi-servicecenters.md b/_syncer/cn/multi-servicecenters.md index 6be721a..47e7830 100644 --- a/_syncer/cn/multi-servicecenters.md +++ b/_syncer/cn/multi-servicecenters.md @@ -77,8 +77,8 @@ management: $ cd ${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/eureka/eureka-server/ $ nohup mvn spring-boot:run & >> eureka-server.log 2>&1 & ``` -浏览器打开http://10.0.0.10:8761,若出现如下页面,则启动成功 - + 浏览器打开http://10.0.0.10:8761,若出现如下页面,则启动成功 +  #### 3. 启动AccountServer - 修改启动配置 @@ -100,48 +100,48 @@ management: web: exposure: include: "*" -``` -- 启动服务 +``` + +- 启动服务 ```bash #启动 AccountServer $ cd ${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/eureka/account-server $ mvn spring-boot:run - # 出现如下字样则为成功 2019-09-19 17:20:35.534 INFO 20890 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8090 (http) with context path '' 2019-09-19 17:20:35.548 INFO 20890 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8090 2019-09-19 17:20:35.551 INFO 20890 --- [ main] o.a.s.s.account.AccountApplication : Started AccountApplication in 3.92 seconds (JVM running for 6.754) 2019-09-19 17:20:35.617 INFO 20890 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ACCOUNT-SERVER/10.0.0.10:account-server:8090 - registration status: 204 ``` -此时打开http://10.0.0.10:8761,可以看到AccountServer已经注册成功 - + + 此时打开http://10.0.0.10:8761,可以看到AccountServer已经注册成功 +  #### 4. 启动Syncer ```bash $ cd ${project_dir}/apache-servicecomb-service-center-1.3.0-linux-amd64/ $ ./syncer daemon --sc-addr http://10.0.0.10:8761/eureka --bind-addr 10.0.0.10:30190 --rpc-addr 10.0.0.10:30191 --sc-plugin=eureka --node eureka - -# 出现如下字样则为成功 -2019-09-19T17:28:28.809+0800 INFO etcd/agent.go:55 start etcd success -2019-09-19T17:28:28.809+0800 INFO grpc/server.go:94 start grpc success -2019-09-19T17:28:28.809+0800 DEBUG server/handler.go:39 is leader: true -2019-09-19T17:28:28.809+0800 DEBUG server/handler.go:43 Handle Tick +#出现如下字样则为成功 +2019-09-19T17:28:28.809+0800 INFO etcd/agent.go:55 start etcd success +2019-09-19T17:28:28.809+0800 INFO grpc/server.go:94 start grpc success +2019-09-19T17:28:28.809+0800 DEBUG server/handler.go:39 is leader: true +2019-09-19T17:28:28.809+0800 DEBUG server/handler.go:43 Handle Tick ``` -### 步骤2:启动Servicecenter环境和服务 -机器: 10.0.0.11 -#### 1. 编译项目 +### 步骤2:启动Servicecenter环境和服务 +机器: 10.0.0.11 +#### 1. 编译项目 ```bash $ cd ${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/servicecenter/hello-server/ $ GO111MODULE=on go build -``` -#### 2. 启动Servicecenter +``` + +#### 2. 启动Servicecenter - 修改启动配置: 文件位置:${project_dir}/apache-servicecomb-service-center-1.3.0-linux-amd64/conf/app.conf -```conf +```bash frontend_host_ip = 10.0.0.11 frontend_host_port = 30103 - ################################################################### # sever options ################################################################### @@ -156,19 +156,17 @@ httpport = 30100 - 启动 ServiceCenter 和 Frontend ```bash $ cd ${project_dir}/apache-servicecomb-service-center-1.3.0-linux-amd64 - # 启动 ServiceCenter $ ./start-service-center.sh - # 启动 前端页面 Frontend $ ./start-frontend.sh ``` -浏览器打开http://10.0.0.11:30103,若出现如下页面,则启动成功 - + 浏览器打开http://10.0.0.11:30103,若出现如下页面,则启动成功 +  #### 3. 启动HelloServer - 修改启动配置: - 文件位置:${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/servicecenter/hello-server/conf/microservice.yaml + 文件位置:${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/servicecenter/hello-server/conf/microservice.yaml ```yml service: # 微服务配置 appId: eureka # eureka 中同步的实例appID均为:eureka @@ -183,27 +181,28 @@ provider: # 服务端信息 version: 0.0.1 registry: address: http://10.0.0.11:30100 -``` +``` -- 启动服务 +- 启动服务 ```bash $ cd ${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/servicecenter/hello-server $ ./hello-server 2019-09-19T18:37:50.645+0800 DEBUG servicecenter/servicecenter.go:163 send heartbeat success 2019-09-19T18:37:50.645+0800 WARN servicecenter/servicecenter.go:85 discovery provider failed, appID = eureka, name = account-server, version = 0.0.1 2019-09-19T18:37:50.645+0800 INFO servicecenter/servicecenter.go:87 waiting for retry -``` -此时打开http://10.0.0.11:30103,可以看到HelloServer已经注册成功 - -但由于无法发现属于Eureka服务中心的AccountServer实例,HelloServer处于重试状态 -(==注:重试次数为3次,每次间隔30秒,所以我们需要在90秒内完成后面的操作==) +``` + + 此时打开http://10.0.0.11:30103,可以看到HelloServer已经注册成功 +  + 但由于无法发现属于Eureka服务中心的AccountServer实例,HelloServer处于重试状态 + (==注:重试次数为3次,每次间隔30秒,所以我们需要在90秒内完成后面的操作==) -#### 4.启动Syncer +#### 4.启动Syncer ```bash $ cd ${project_dir}/apache-servicecomb-service-center-1.3.0-linux-amd64/ $ ./syncer daemon --sc-addr http://10.0.0.11:30100 --bind-addr 10.0.0.11:30190 --rpc-addr 10.0.0.11:30191 --sc-plugin=servicecenter --join-addr 10.0.0.10:30190 --node servicecenter -# 出现以下内容则为Syncer成功启动,并同步了对方的实例 +#出现以下内容则为Syncer成功启动,并同步了对方的实例 2019-09-19T18:44:35.536+0800 DEBUG server/handler.go:62 is leader: true 2019-09-19T18:44:35.536+0800 DEBUG server/handler.go:79 Receive serf user event 2019-09-19T18:44:35.536+0800 DEBUG serf/agent.go:130 member = servicecenter, groupName = 0204d59328090c2f4449a088d4e0f1d8 @@ -213,16 +212,16 @@ $ ./syncer daemon --sc-addr http://10.0.0.11:30100 --bind-addr 10.0.0.11:30190 - 2019-09-19T18:44:35.538+0800 DEBUG servicecenter/servicecenter.go:87 create service success orgServiceID= account-server, curServiceID = 80784229255ec96d90353e3c041bdf3586fdbbae 2019-09-19T18:44:35.538+0800 DEBUG servicecenter/servicecenter.go:90 trying to do registration of instance, instanceID = 10.0.0.10:account-server:8090 2019-09-19T18:44:35.540+0800 DEBUG servicecenter/sync.go:63 Registered instance successful, instanceID = 78bca3e2daca11e99638fa163eca30e0 -``` +``` ### 步骤3:结果验证 1. 此时的HelloServer获取实例成功,并调用了AccountServer的CheckHealth接口 - +  -2. 分别打开Euraka和ServiceCenter的网页,两个服务中心里均包含了所有的实例信息 - - -3. curl命令调用HelloServer的Login接口 +2. 分别打开Euraka和ServiceCenter的网页,两个服务中心里均包含了所有的实例信息 +  +  +3. curl命令调用HelloServer的Login接口 ```bash $ curl -X POST \ http://192.168.88.75:8091/login \ @@ -232,9 +231,9 @@ http://192.168.88.75:8091/login \ "password":"123456" }' welcome Jack -``` +``` HelloServer与AccountServer分别会打印如下的信息 -AccountServer - +AccountServer +  HelloServer - +  diff --git a/_syncer/multi-servicecenters.md b/_syncer/multi-servicecenters.md index 8a519cf..3dcc8c0 100644 --- a/_syncer/multi-servicecenters.md +++ b/_syncer/multi-servicecenters.md @@ -75,8 +75,8 @@ management: $ cd ${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/eureka/eureka-server/ $ nohup mvn spring-boot:run & >> eureka-server.log 2>&1 & ``` -Open http://10.0.0.10:8761 in the browser, this is successful if the following page appears. - + Open http://10.0.0.10:8761 in the browser, this is successful if the following page appears. +  #### 3. Run AccountServer - Modify the startup configuration @@ -103,66 +103,60 @@ management: ```bash $ cd ${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/eureka/account-server $ mvn spring-boot:run - -# This is successful if the result like this, +#This is successful if the result like this, 2019-09-19 17:20:35.534 INFO 20890 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8090 (http) with context path '' 2019-09-19 17:20:35.548 INFO 20890 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8090 2019-09-19 17:20:35.551 INFO 20890 --- [ main] o.a.s.s.account.AccountApplication : Started AccountApplication in 3.92 seconds (JVM running for 6.754) 2019-09-19 17:20:35.617 INFO 20890 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_ACCOUNT-SERVER/10.0.0.10:account-server:8090 - registration status: 204 ``` -Reopen http://10.0.0.10:8761, you can see that AccountServer has been registered successfully. - + Reopen http://10.0.0.10:8761, you can see that AccountServer has been registered successfully. +  #### 4. Run Syncer of eureka ```bash $ cd ${project_dir}/apache-servicecomb-service-center-1.3.0-linux-amd64/ $ ./syncer daemon --sc-addr http://10.0.0.10:8761/eureka --bind-addr 10.0.0.10:30190 --rpc-addr 10.0.0.10:30191 --sc-plugin=eureka --node eureka - -# This is successful if the result like this, +#This is successful if the result like this, 2019-09-19T17:28:28.809+0800 INFO etcd/agent.go:55 start etcd success 2019-09-19T17:28:28.809+0800 INFO grpc/server.go:94 start grpc success 2019-09-19T17:28:28.809+0800 DEBUG server/handler.go:39 is leader: true 2019-09-19T17:28:28.809+0800 DEBUG server/handler.go:43 Handle Tick ``` -### Step 2: Start the Servicecenter environment and services +### Step 2: Start the Servicecenter environment and services Another machine: 10.0.0.11 -#### 1. Compile HelloServer +#### 1. Compile HelloServer ```bash $ cd ${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/servicecenter/hello-server/ $ GO111MODULE=on go build ``` -#### 2. Run Servicecenter +#### 2. Run Servicecenter - Modify the startup configuration: File path:${project_dir}/apache-servicecomb-service-center-1.3.0-linux-amd64/conf/app.conf -```conf +```bash frontend_host_ip = 10.0.0.11 frontend_host_port = 30103 - -################################################################### -# sever options -################################################################### -# if you want to listen at ipv6 address, then set the httpaddr value like: -# httpaddr = 2400:A480:AAAA:200::159 (global scope) -# httpaddr = fe80::f816:3eff:fe17:c38b%eth0 (link-local scope) +#sever options +#if you want to listen at ipv6 address, then set the httpaddr value like: +#httpaddr = 2400:A480:AAAA:200::159 (global scope) +#httpaddr = fe80::f816:3eff:fe17:c38b%eth0 (link-local scope) httpaddr = 10.0.0.11 httpport = 30100 -# ...以下省略... -``` +#...以下省略... +``` -- Run ServiceCenter and Frontend +- Run ServiceCenter and Frontend ```bash $ cd ${project_dir}/apache-servicecomb-service-center-1.3.0-linux-amd64 $ ./start-service-center.sh $ ./start-frontend.sh -``` -Open http://10.0.0.11:30103 in the browser, this is successful if the following page appears. - - +``` + Open http://10.0.0.11:30103 in the browser, this is successful if the following page appears. +  -#### 3. Run HelloServer +#### 3. Run HelloServer - Modify the startup configuration - File path:${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/servicecenter/hello-server/conf/microservice.yaml + File path:${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/servicecenter/hello-server/conf/microservice.yaml ```yml service: # Micro service configuration appId: eureka # The appID is "eureka", if the instance synced from eureka. @@ -179,26 +173,24 @@ registry: address: http://10.0.0.11:30100 ``` -- Start HelloServer +- Start HelloServer ```bash $ cd ${project_dir}/servicecomb-service-center/syncer/samples/multi-servicecenters/servicecenter/hello-server $ ./hello-server 2019-09-19T18:37:50.645+0800 DEBUG servicecenter/servicecenter.go:163 send heartbeat success 2019-09-19T18:37:50.645+0800 WARN servicecenter/servicecenter.go:85 discovery provider failed, appID = eureka, name = account-server, version = 0.0.1 2019-09-19T18:37:50.645+0800 INFO servicecenter/servicecenter.go:87 waiting for retry -``` -Reopen http://10.0.0.11:30103, you can see that HelloServer has been registered successfully. - - -But, the instance of AccountServer belonging to the EurekaServer cannot be found, the HelloServer is in the retry state. -(**_Warning_**: We must complete the operation within 3 retry times (90 seconds)) +``` + Reopen http://10.0.0.11:30103, you can see that HelloServer has been registered successfully. +  + But, the instance of AccountServer belonging to the EurekaServer cannot be found, the HelloServer is in the retry state. + (**_Warning_**: We must complete the operation within 3 retry times (90 seconds)) -#### 4.Run Syncer of service-center +#### 4.Run Syncer of service-center ```bash $ cd ${project_dir}/apache-servicecomb-service-center-1.3.0-linux-amd64/ $ ./syncer daemon --sc-addr http://10.0.0.11:30100 --bind-addr 10.0.0.11:30190 --rpc-addr 10.0.0.11:30191 --sc-plugin=servicecenter --join-addr 10.0.0.10:30190 --node servicecenter - -# This is successful if the result like this, +#This is successful if the result like this, 2019-09-19T18:44:35.536+0800 DEBUG server/handler.go:62 is leader: true 2019-09-19T18:44:35.536+0800 DEBUG server/handler.go:79 Receive serf user event 2019-09-19T18:44:35.536+0800 DEBUG serf/agent.go:130 member = servicecenter, groupName = 0204d59328090c2f4449a088d4e0f1d8 @@ -208,16 +200,16 @@ $ ./syncer daemon --sc-addr http://10.0.0.11:30100 --bind-addr 10.0.0.11:30190 - 2019-09-19T18:44:35.538+0800 DEBUG servicecenter/servicecenter.go:87 create service success orgServiceID= account-server, curServiceID = 80784229255ec96d90353e3c041bdf3586fdbbae 2019-09-19T18:44:35.538+0800 DEBUG servicecenter/servicecenter.go:90 trying to do registration of instance, instanceID = 10.0.0.10:account-server:8090 2019-09-19T18:44:35.540+0800 DEBUG servicecenter/sync.go:63 Registered instance successful, instanceID = 78bca3e2daca11e99638fa163eca30e0 -``` +``` -### Step 3: Results Verification +### Step 3: Results Verification 1. At this point, HelloServer gets the instance successfully, and calls the CheckHealth interface of AccountServer. - +  -2. Open the website of Euraka and ServiceCenter respectively. Both service centers contain all the instance information. - - -3. Call the Login interface of HelloServer used the command line of curl, +2. Open the website of Euraka and ServiceCenter respectively. Both service centers contain all the instance information. +  +  +3. Call the Login interface of HelloServer used the command line of curl, ```bash $ curl -X POST \ http://192.168.88.75:8091/login \ @@ -228,8 +220,8 @@ http://192.168.88.75:8091/login \ }' welcome Jack ``` -HelloServer and AccountServer respectively print the following information. -AccountServer - -HelloServer - +HelloServer and AccountServer respectively print the following information. +AccountServer +  +HelloServer + 
