0
votes

I downloaded WS02 and I needed some help in setting up the product in a dockerized env. I downloaded an example of building a WSO2 API-M environment with DAS. https://github.com/nuwanbando/wso2-apim-distributed-deployment

I was able to get it working and was also able to view the published statistics using DAS. But from your example, I want to go one step further and split gateway  gateway manager and gateway- worker. For this I, copied the gateway into a new folder and for each of the startup scripts I added the product profile. For ex. in the worker folder, I added the startup like the following. CMD ["sh", "/wso2/wso2am-1.10.0/bin/wso2server.sh", "-Dprofile=gateway-worker", "-DworkerNode=true"]. After this set up, it looks like the stats are not getting published and I do not see any statistics published. I tried to browse the tables in Data Explorer in the DAS UI and it is empty. Could you please give me some pointers on what I might be doing wrong? I’m attaching my compose. I’d appreciate the any help.

version: '2'

services:

dbms:
 container_name: apim_apimrdbms
 build:
    context: .
    dockerfile: database/Dockerfile
 ports:
  - "3306:3306"
 environment:
    MYSQL_ROOT_PASSWORD: root
gateway:
 container_name: apim_gateway
 depends_on:
   - dbms
 build:
  context: .
  dockerfile: gateway/Dockerfile
 ports:
  - "9763:9763"
  - "9443:9443"
  - "8280:8280"
  - "8243:8243"
worker:
 container_name: apim_worker
 depends_on:
   - dbms
 build:
  context: .
  dockerfile: gateway-worker/Dockerfile
 ports:
  - "9763:9763"
  - "9443:9443"
  - "8280:8280"
  - "8243:8243"
km:
 container_name: apim_km
 depends_on:
  - dbms
 build:
  context: .
  dockerfile: keymanager/Dockerfile
 ports:
  - "9764:9763"
  - "9444:9443"
publisher:
 container_name: apim_publisher
 depends_on:
  - dbms
 build:
  context: .
  dockerfile: publisher/Dockerfile
 ports:
  - "9765:9763"
  - "9445:9443"
  - "4000"
store:
 container_name: apim_store
 depends_on:
  - dbms
 build:
  context: .
  dockerfile: store/Dockerfile
 ports:
  - "9766:9763"
  - "9446:9443"
  - "4000"
das:
 container_name: apim_das
 depends_on:
  - dbms
 build:
  context: .
  dockerfile: das/Dockerfile
 ports:
  - "9767:9763"
  - "9447:9443"
2

2 Answers

1
votes

It is not straight forward to cluster the GW nodes. You need to configure SVN based deployment synchronization for this as well. You can find some APIM deployment patterns with clustered GW nodes from here. And you can follow this guide to to cluster API Manager. You can refer this to configure statistics

Also You only need to specify following Flag to run as worker node.

-Dprofile=gateway-worker
0
votes

Try configuring your publisher node and store node to point to the manager and worker node as follows.

 <APIGateway>
        <ServerURL>https://${gatewaymanager_ip}:${mgt.transport.https.port}${carbon.context}/services/</ServerURL>
        <GatewayEndpoint>http://${gatewayworker}:${http.nio.port},https://${carbon.local.ip}:${https.nio.port}</GatewayEndpoint>                  
 </APIGateway>

ServerURL should point to the manager node whereas the GatewayEndpoint should point to the worker nodes.