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

Centralized restart service #5085

Closed

Conversation

yenienserrano
Copy link
Member

Description:

The way to restart the manager or cluster was centralized in a service since each view that had the option to restart did it differently.

In order to allow the cluster to synchronize ruleset changes, a delay was applied before restarting Wazuh. This delay has been removed as it's been replaced by a polling system, so it's no longer required. The app will ping the Wazuh API and wait until it's back up again. If this does not happen, the app will show an error message, as the API did not come back online.

Due to the changes of this development, code has been removed as it was no longer used.

PR above with more information (a revert was made):

Issue:

Test:

To test it you have to go to any page that has the restart option and try doing the restart, when it tells you that it has restarted try navigating between pages that make requests to the API.

Successful restart

  1. Navigate to one of the following sections:
  • Management > Configuration > Edit configuration
  • Management > Status
  • Management > Rules and edit file
  • Management > Decoders and edit file
  • Management > CDB lists and edit file
  1. Click on the restart button and wait until it's done.
  2. Navigate to another route that uses some request for the API, and check that no error is thrown.

Restart failure

  1. Navigate to one of the following sections:
  • Management > Configuration > Edit configuration
  • Management > Status
  • Management > Rules and edit file
  • Management > Decoders and edit file
  • Management > CDB lists and edit file
  1. Click on the restart button and wait until it's done.
  2. Once the first polling cycle is done, disconnect the manager from the app (in Docker, stop the container).
  3. Wait until the modal changes state, showing that the restart has failed. A button to redirect to the Healthcheck must also appear. Check this button works properly.

Screenshot:

Ongoing restart:

image

Successfully restarted:

image

Restart error:

image

Cluster synchronization:

image

Cluster synchronization error:

image

yenienserrano and others added 30 commits August 12, 2022 17:22
* file to be added with the restart functions

* restart calls were changed to service calls

* the restarting on time sign appears

* modal while restarting added

* countDown change of location

* cleaning

* modal redesign

* model and code update

* modified delays and designs

* change text Synchronizing cluster

* Update restart-cluster-manager-callout.tsx

* Code improvements

* suggestions implemented

* polling sync add

* Code improvements

* add endpoint

* add comment

* add close button

* suggestions implemented

* add modal wazuh restarted

* delete unnecessary toast

* Set clearState on restart error

* disabled unneeded console.log

Co-authored-by: Alex Ruiz Becerra <[email protected]>
Co-authored-by: Federico Rodriguez <[email protected]>
Co-authored-by: chantal.kelm <[email protected]>
(cherry picked from commit 6598df9)
* Create service to restart wazuh (#4365)

* file to be added with the restart functions

* restart calls were changed to service calls

* the restarting on time sign appears

* modal while restarting added

* countDown change of location

* cleaning

* modal redesign

* model and code update

* modified delays and designs

* change text Synchronizing cluster

* Update restart-cluster-manager-callout.tsx

* Code improvements

* suggestions implemented

* polling sync add

* Code improvements

* add endpoint

* add comment

* add close button

* suggestions implemented

* add modal wazuh restarted

* delete unnecessary toast

* Set clearState on restart error

* disabled unneeded console.log

Co-authored-by: Alex Ruiz Becerra <[email protected]>
Co-authored-by: Federico Rodriguez <[email protected]>
Co-authored-by: chantal.kelm <[email protected]>
(cherry picked from commit 6598df9)

* Updated Changelog

Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Chantal Belén kelm <[email protected]>
* fix: Fixed a routes loop when reinstalling Wazuh indexer

* fix: replaced the display error in the plugin loop

* changelog: add PR entry

* fix import variable

Co-authored-by: Matias Ezequiel Moreno <[email protected]>
…4401)

Moved the file config-equivalences to common (#4399)

* common/config-equivalences

* add changelog

(cherry picked from commit a40a2ae)

Co-authored-by: Ian Yenien Serrano <[email protected]>
Signed-off-by: yenienserrano <[email protected]>
* file to be added with the restart functions

* restart calls were changed to service calls

* the restarting on time sign appears

* modal while restarting added

* countDown change of location

* cleaning

* modal redesign

* model and code update

* modified delays and designs

* change text Synchronizing cluster

* Update restart-cluster-manager-callout.tsx

* Code improvements

* suggestions implemented

* polling sync add

* Code improvements

* add endpoint

* add comment

* add close button

* suggestions implemented

* add modal wazuh restarted

* delete unnecessary toast

* Set clearState on restart error

* disabled unneeded console.log

Co-authored-by: Alex Ruiz Becerra <[email protected]>
Co-authored-by: Federico Rodriguez <[email protected]>
Co-authored-by: chantal.kelm <[email protected]>
(cherry picked from commit 6598df9)
Signed-off-by: yenienserrano <[email protected]>
* Use POST method when requesting the API login endpoint

* changelog: add PR entry

Co-authored-by: Matias Ezequiel Moreno <[email protected]>
Co-authored-by: Álex <[email protected]>
Co-authored-by: Antonio David Gutiérrez <[email protected]>
(cherry picked from commit 3977e45)

Co-authored-by: Manuel Carmona Pérez <[email protected]>
…rvice config (#4322)

Added new key request block in Registration service config (#3956)

* Added new key request block

* Removed failed snapshots

* Updated some test snapshots

* Updated descriptions registration-service

(cherry picked from commit 2b6ecf3)

Co-authored-by: Maximiliano Ibarra <[email protected]>
Sorting by agents in the table groups (#4323)

* Added sortable by agent count option to the groups table

* Added changelog entry

Co-authored-by: Álex <[email protected]>
(cherry picked from commit 9079f07)

Co-authored-by: Ian Yenien Serrano <[email protected]>
@yenienserrano yenienserrano linked an issue Feb 6, 2023 that may be closed by this pull request
@yenienserrano yenienserrano changed the base branch from 4.4-2.4-wzd to 4.5 February 9, 2023 08:15
@github-actions
Copy link
Contributor

Code coverage (Jest) % values
Statements 9.17% ( 3394 / 37001 )
Branches 4.72% ( 1354 / 28648 )
Functions 8.01% ( 735 / 9176 )
Lines 9.23% ( 3273 / 35429 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Centralized service to restart Wazuh
5 participants