0

I am currrently using 4 WSO2 modules inside my docker-compose file as shown below:

mysql:
    image: mysql:5.7.31
    container_name: mysql
    ports:
      - 3306
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - ./conf/mysql/scripts:/docker-entrypoint-initdb.d
      - ./conf/mysql/conf/my.cnf:/etc/mysql/my.cnf
    ulimits:
      nofile:
        soft: 20000
        hard: 40000
    command: --ssl=0 --max_connections=10000
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-uroot", "-proot"]
      interval: 30s
      timeout: 60s
      retries: 5
      start_period: 80s

  am-analytics-worker:
    image: wso2am-analytics-worker:3.2.0
    container_name: am-analytics-worker
    ports:
      - "9091"
      - "9444"
    healthcheck:
      test: ["CMD", "nc", "-z","localhost", "9444"]
      interval: 10s
      start_period: 20s
      retries: 5
    depends_on:
      mysql:
        condition: service_healthy
    volumes:
      - ./conf/apim-analytics-worker:/home/wso2carbon/wso2-config-volume

  api-manager:
    image: wso2am:3.2.0
    container_name: api-manager
    healthcheck:
      test: ["CMD", "nc", "-z","localhost", "9443"]
      interval: 10s
      start_period: 180s
      retries: 20
    depends_on:
      mysql:
        condition: service_healthy
      am-analytics-worker:
        condition: service_healthy
    volumes:
      - ./conf/apim:/home/wso2carbon/wso2-config-volume
      - ./conf/apim_artifacts:/home/wso2carbon/wso2-artifact-volume

    ports:
      - "9443:9443"
      - "8280:8280"
      - "8243:8243"
      
  am-analytics-dashboard:
    image: wso2am-analytics-dashboard:3.2.0
    container_name: am-analytics-dashboard
    ports:
      - "9643:9643"
    healthcheck:
      test: ["CMD", "nc", "-z","localhost", "9643"]
      interval: 10s
      retries: 5
      start_period: 20s
    depends_on:
      mysql:
        condition: service_healthy
      api-manager:
        condition: service_healthy
    volumes:
      - ./conf/apim-analytics-dashboard:/home/wso2carbon/wso2-config-volume

I have create somed apis in WSO2 Api Manager and the issue is that if my container reboots I loose all my APIs.

So here is what I tried in order to have some data persistence with my apis so that they remain avaible even if the Api Manager container reboots.

First, I copied the whole wso2am-3.2.0 folder from the container to my computer and then based on this link (WSO2 Runtime Artifacts) I have created a folder named "apim_artifacts" and inside I have placed the 4 runtime artifacts (<API-M_HOME>/repository/deployment/server, <API-M_HOME>/repository/tenants, <API-M_HOME>/solr, <API-M_HOME>/repository/database) as suggested by the WSO2 documentation.

Now, when I compose my project the apis are still not visible in the publisher.

localhost:9443/publisher/apis

But if I go check inside the Api Manager container I can see that all the folders I have mounted with my volume have been copied and mapped into their respective folders (I can even see all my apis inside the /home/wso2carbon/wso2am-3.2.0/repository/deployment/server/synapse-configs/default/endpoints folder).

Am I missing something or is there something I am doing wrong?

Could you please help me out?

Regards,

Yannick
  • 59
  • 7
  • This could due to an issue in indexing. IF the APIs are not indexed properly, then you can index the APIs by adding the following config to the deployment.toml [indexing] re_indexing = 1 – Pubci Feb 28 '21 at 16:19
  • Before doing the indexing, you can remove the following mounts and see whether it works. These two mounts are required for indexing. /solr, /repository/database – Pubci Feb 28 '21 at 16:21
  • I tried both (removing the 2 folders and reindexing) but the apis are still not visible. What I have noticed though is that when I import an api manually via apictl the file permission is -rw-r--r-- 1 wso2carbon wso2 but all the apis that I import with the mounted volume have file permision set to -rwxr-xr-x 1 wso2carbon wso2. Could that be related to the issue? – Yannick Feb 28 '21 at 21:15
  • No, the API listing in both Publisher and Devportal are picked from the Solr indexes. Therefore, even if you have a valid Synapse artifact in your environment, if the Solr indexes are not properly indexed, the APIs will not be listed in both Publisher and Devportals. Try performing the re-indexing as mentioned earlier and keep the servers untouched for about 20 minutes and then try accessing the portals. The indexing process will take a considerable time depending on the number of APIs that you are having. – Athiththan Jun 26 '21 at 18:38

0 Answers0