Let’s just take the ‘hello-vertx’ project as an example. First I start Okapi with the storage of postgreSQL. Then create the tenant: ‘testlib’ and the module:‘hello’, deploy this module and enable it for ‘testlib’. Of course these infomations have been stored into the ‘tenants’ and ‘modules’ tables of postgreSQL. The ‘hello’ module runs well. After executed all these steps, I tried stopping Okapi and restarting it. At this time, when I sent a GET request to the ‘/_/deployment/modules’ interface, Okapi just returned an empty Array:’[ ]’. This means the ‘hello’ module did not follow the Okapi to restart. **_
My Question is: Do I have to redeploy the module manually by sending the POST request to the ‘/_/deployment/modules’ interface?
Has Okapi already implemented to deploy modules automatically? If so , how could I do this?
Another important question :
I want to deploy Okapi and hello-vertx on different servers. How to do this? What special configurations do I have to pay attention? How can Okapi deploy a remote-server module?
Yes, you have to deploy the module again. The reasoning behind this is that we did not want to store information about running processes in the database - processes can come and go, and the database would not be up to date anyway.
The idea is that there should be an Okapi instance running on each of your servers, in ‘cluster’ mode. Then you can any of the Okapis to list all your nodes in /_/discovery/nodes. When you deploy your modules, you can specify which node to deploy on.
Alternatively, you can manage the deployment outside Okapi, and just post a deploymentDescriptor that has a URL to an already-running instance.
Then how can I deploy okapi instances on different nodes with ‘cluster mode’ and make relationship with each other. Which section of the document introduces that?
I have to admit that it is not well explained in the guide. When you start
up Okapi, skip the ‘dev’ mode, and put ‘cluster’ instead. The reference
section mentions a few options you can give.
I know to replace ‘dev’ as ‘cluster’,but how to make these nodes work together? I did started Okapi on different computers. Even though in the ‘cluster’ mode, they would be working separately as independent nodes. What have to be configured in this situation? After I send request to the ‘/_/deployment/nodes’, there should be a multi-nodes Array returned.