Community for yuuvis® RAD

+1 vote
by (740 points)

Hi,

how can I deploy a new version of a microservice without need to restart the service manager?
ATM it is not possible because SAM says that it can not remove existing service while it is in use.

Problem is, that restarting the whole service manager takes minutes until all services are up again and so this is not a good approach for continuous integration.

Any suggestions?

3 Answers

+2 votes
by (510 points)
selected by
 
Best answer

There is another method that I think is a little bit more comfortable.
Go to the Swagger UI of the ARGUS service and open the
apps-management-resource endpoints. Here you can see a PUT call (/manage/apps/{service}/instances) to set the number of instances of a service. Now set the instances for your service to 0 and click 'Try it out!

The number of instances will be adjusted in servicewatcher-sw.yml and the ARGUS service will automatically update its configuration.

Update your service as usual via the SAM tool or via the endpoint /manage/apps/updatemultipart. Then set the instances back to the desired number.
The advantage of this method is that you do not edit the servicewatcher-sw.yml yourself, but trigger it with a REST call.

+2 votes
by (1.9k points)

It is possible to stop iondividual services.
For that you have to get into the servicewatcher-sw.yml and edit the entry for the service you want to update. Add/edit the line "instances: 0".
After that, you have to get to the swagger-ui of the ARGUS service, which you can usually find under <enaio-server-address>:7281/swagger-ui.html.
You can aslo navigate to that address via the "enaio Services Admin" Page that you can usually find behin port 7273.

After getting to the swagger-ui, you have to go the "generic-postable-mvc-endpoint" -> "/manage/refresh" and press "Try it out!".

The swagger-ui page should look like this:

This will refresh the service manager and reload the servicewatcher-sw.yml. With "instances: 0" it will now stop the Microservice, which allows you to update the Microservice by using the sam tool or replacing the jar direcrtly.

After you made your changes, either remove "instances: 0" or set it to 1 (or whatever number you had previously) and refresh the service watcher again using the method above.
That should then start the now updated micrservice again.

During the whole procedure all the other services continues running, so there should be no downtime at all.

0 votes
by (11.9k points)

There is also a "quick&dirty" alternative - that is of course not recommended for any production system but for development systems it can be useful:
- overwrite the existing microservice jar-file with the new jar-file (this is possible even if the microservice is running)
- kill the java-process of the running microservice instance and let the service-watcher restart it (automatically done when the missing instance is detected).

The new instance will use the new jar-file.

by (740 points)
This seems to not function properly because by trying to overwrite the file, windows says it is in use by another application...

Related questions

+1 vote
2 answers
+1 vote
3 answers
+1 vote
2 answers
asked Dec 13, 2018 by gbalatckii (1.2k points)
...