Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make instance restart function capable of restarting the cluster #22507

Closed
swicken-dotcms opened this issue Jul 1, 2022 · 3 comments · Fixed by #24832
Closed

Make instance restart function capable of restarting the cluster #22507

swicken-dotcms opened this issue Jul 1, 2022 · 3 comments · Fixed by #24832

Comments

@swicken-dotcms
Copy link
Contributor

swicken-dotcms commented Jul 1, 2022

Is your feature request related to a problem? Please describe.
We added the ability to restart instances to dotCMS, however it only restarts the node you are connected to

Ticket: https://dotcms.zendesk.com/agent/tickets/107796

Describe the solution you'd like
Give an additional option to restart the entire cluster

Describe alternatives you've considered
After restarting the node you are connected to, you could refresh and get to a new node and hit restart on that as well, but with a lot of nodes this could be inconsistent.

HOW THE DOTCMS CLUSTER RESTART WORKS

Here's an example based on a two-node dotCMS Cluster:

-> FROM THE MAINTENANCE PORTLET:

  1. Set up a working dotCMS Cluster. For Docker, please refer to: https://github.com/dotCMS/core/tree/master/docker/docker-compose-examples/cluster-mode
  2. Once you made sure you can log into both nodes, go to the Settings > Maintenance > Tool portlet in any of them and scroll down to the bottom all the way to the Shutdown dotCMS section.
  3. Check both I agree with the above and Shutdown dotCMS Cluster boxes.
  4. The Rolling Delay in Seconds field will show up. For testing purposes, enter a lower value for it, for instance, 10. As you can see in the UI, this field allows you to set the number of seconds between each node in the cluster restarting.
  5. Keep an eye on the log file from both nodes. Finally, click SHUTDOWN DOTCMS.
  6. The node you're currently logged in will shut down immediately. The other node will restart after the specified amount of seconds. You can confirm the expected timing of the operation by checking the logs.

-> VIA THE REST ENDPOINT:

Using Postman, create a DELETE request with Basic Auth for the following Endpoint: http://localhost:8080/api/v1/maintenance/_shutdownCluster?rollingDelay=10 . The expected outcome must be the same as in the previous section -- i.e., shutting down the current node immediately , and the second node going down after 10 secs.

@stale
Copy link

stale bot commented Dec 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@jcastro-dotcms
Copy link
Contributor

The ticket's description has been updated with an explanation on how the cluster restart process can be achieved via the dotCMS back-end, and the REST Endpoint.

wezell added a commit that referenced this issue Jul 11, 2023
* #22507 adds cluster aware shutdown

* #22507 adds cluster aware shutdown

* #22507 making the topic match

* #22507 I restart first

* Implementing minor SonarQube feedback.

* Implementing minor SonarQube feedback.

* Implementing Code Review feedback.

---------

Co-authored-by: Jose Castro <jose.castro@dotcms.com>
Co-authored-by: Jonathan <jonathan.sanchez@dotcms.com>
@wezell wezell added the Merged label Jul 11, 2023
@bryanboza
Copy link
Member

Fixed, tested on the QA server and now we are able to restart the entire cluster without problems.

Tested with the last master // Docker

@erickgonzalez erickgonzalez added the LTS : Next Ticket that will be added to LTS label Aug 10, 2023
@erickgonzalez erickgonzalez added Next LTS Release and removed LTS : Next Ticket that will be added to LTS labels Sep 6, 2023
erickgonzalez added a commit that referenced this issue Sep 14, 2023
@erickgonzalez erickgonzalez added the Release : 22.03.10 Included in LTS patch release 22.03.10 label Sep 18, 2023
erickgonzalez added a commit that referenced this issue Sep 26, 2023
@erickgonzalez erickgonzalez added the Release : 23.01.7 Included in LTS patch release 23.01.7 label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants