-
Notifications
You must be signed in to change notification settings - Fork 186
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 service to restart Wazuh #4277
Comments
ResearchIn the current plugin there is some methods that are being reused:
Restart selected manager node: https://github.com/wazuh/wazuh-kibana-app/blob/v4.3.4-7.10.2/public/controllers/management/components/management/configuration/utils/wz-fetch.js#L270-L287 Restart cluster or manager: https://github.com/wazuh/wazuh-kibana-app/blob/v4.3.4-7.10.2/public/controllers/management/components/management/configuration/utils/wz-fetch.js#L528-L549
For another hand, there is another logic used by We could try to refactor to use the same service/functions and unify the behavior. Possible tasks:
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
these functions were moved to a service to handle the restarting (wz-restart.js) restartManager and restartCluster were changed by 1 function restart Restart selected manager node: https://github.com/wazuh/wazuh-kibana-app/blob/v4.3.4-7.10.2/public/controllers/management/components/management/configuration/utils/wz-fetch.js#L270-L287 Restart cluster or manager: https://github.com/wazuh/wazuh-kibana-app/blob/v4.3.4-7.10.2/public/controllers/management/components/management/configuration/utils/wz-fetch.js#L528-L549 Change For another hand, there is another logic used by The 2 functions were eliminated as they were doing the same things and we started using the created service Change and it is also called in the file |
|
Closed until priorities change |
Related issue: #4181
Description
To follow the discussion on issue #4181, we need to centralize the restart of Wazuh using a React service or component, so any view of the App will be able to restart the environment in the same way.
Restrictions and considerations
In cluster mode, a delay of at least 15 seconds needs to be applied when a cluster restart is immediately triggered after changing the ruleset files, in order to allow the cluster to synchronize the changes along the nodes. This is the safety time the Framework team told us to use.
For a detailed explanation, head to the Wazuh Cluster documentation.
It's possible that Wazuh will only exist as a cluster in the future, and the single-instance mode will exist as a single-node cluster instead. Take this in EXTRAORDINARY consideration during design and coding, so we can easily adjust this service if this eventually happens.
Requirements
Design
Flow
The current flow to restart Wazuh has been modeled in the following activity diagram:
Outdated.- Reason: delay to restart the cluster is no longer required.
Note: rev.2 - Last updated: Thu, 04 Aug 2022 13:40:42 +0200
User Interface
Note: be aware the UI design might change over time, do not take this design as final, unless explicitly specified so.
New, custom, UI components will be needed. We'll work on a PoC using several built-in components from EUI, which will include:
A modal-like element to display the restart status. We'll use the EUI Empty prompt component.
An overlay mask component, used to move the focus to the modal, block user interaction and reinforce the feeling of a task that takes some time to complete.
A progress bar. There are two options here:
a) countdown, starting at delay * total_attempts (2 * 30), and updated each second.
b) current attempt, starting at 0 until total_attempts (30), and updated on each attempt.
We need to discuss which design we like the most. Option B
Note: the progress bar will only reach 0% (option A) or 100% (option B) in the worst case scenario. Wazuh should be completely restarted before this happens.
Preview
Work in progress
This is a demo for the desired design: https://codesandbox.io/s/wazuh-restart-forked-7mnxj1?file=/demo.js
The text was updated successfully, but these errors were encountered: