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

Check if indexer nodes are active before installing the dashboard #1587

Closed
wants to merge 3 commits into from

Conversation

miguelfdez99
Copy link
Contributor

Related issue
#1552

Description

We need to check if the wazuh indexer nodes are active, this was being done at the end.
I changed it to be done before starting the dashboard installation.

Logs example

  • Installing dashboard when indexer nodes are not up
[root@ip-172-31-4-239 ec2-user]# bash wazuh-install.sh --wazuh-dashboard dashboard
30/05/2022 12:05:06 INFO: Starting Wazuh installation assistant. Wazuh version: 4.3.0
30/05/2022 12:05:06 INFO: Verbose logging redirected to /var/log/wazuh-install.log
30/05/2022 12:05:11 INFO: Wazuh repository added.
30/05/2022 12:05:11 INFO: --- Wazuh dashboard ----
30/05/2022 12:05:11 INFO: Checking if Wazuh indexer nodes are active.
30/05/2022 12:05:11 ERROR: Failed to connect with node-1 node-2. Connection refused.
30/05/2022 12:05:11 INFO: If you want to install Wazuh dashboard without waiting for the Wazuh indexer cluster, use the -fd option
30/05/2022 12:05:11 INFO: --- Removing existing Wazuh installation ---
30/05/2022 12:05:11 INFO: Installation cleaned. Check the /var/log/wazuh-install.log file to learn more about the issue.
  • Installing dashboard when cluster is not initialized
[root@ip-172-31-4-239 ec2-user]# bash wazuh-install.sh --wazuh-dashboard dashboard
30/05/2022 12:06:41 INFO: Starting Wazuh installation assistant. Wazuh version: 4.3.0
30/05/2022 12:06:41 INFO: Verbose logging redirected to /var/log/wazuh-install.log
30/05/2022 12:06:46 INFO: Wazuh repository added.
30/05/2022 12:06:46 INFO: --- Wazuh dashboard ----
30/05/2022 12:06:46 INFO: Checking if Wazuh indexer nodes are active.
30/05/2022 12:06:46 ERROR: Wazuh indexer security settings not initialized. Please run the installation assistant using -s|--start-cluster in one of the wazuh indexer nodes.
30/05/2022 12:06:46 INFO: If you want to install Wazuh dashboard without waiting for the Wazuh indexer cluster, use the -fd option
30/05/2022 12:06:46 INFO: --- Removing existing Wazuh installation ---
30/05/2022 12:06:46 INFO: Installation cleaned. Check the /var/log/wazuh-install.log file to learn more about the issue.
  • Using -fd option
[root@ip-172-31-4-239 ec2-user]# bash wazuh-install.sh --wazuh-dashboard dashboard -fd
30/05/2022 12:07:03 INFO: Starting Wazuh installation assistant. Wazuh version: 4.3.0
30/05/2022 12:07:03 INFO: Verbose logging redirected to /var/log/wazuh-install.log
30/05/2022 12:07:08 INFO: Wazuh repository added.
30/05/2022 12:07:08 INFO: --- Wazuh dashboard ----
30/05/2022 12:07:08 INFO: Checking if Wazuh indexer nodes are active.
30/05/2022 12:07:08 WARNING: Wazuh indexer security settings not initialized. Please run the installation assistant using -s|--start-cluster in one of the wazuh indexer nodes.
30/05/2022 12:07:08 INFO: When Wazuh dashboard is able to connect to your Wazuh indexer cluster, you can access the web interface, credentials will be provided at the end of installation.
30/05/2022 12:07:08 INFO: Starting Wazuh dashboard installation.
30/05/2022 12:08:10 INFO: Wazuh dashboard installation finished.
30/05/2022 12:08:10 INFO: Wazuh dashboard post-install configuration finished.
30/05/2022 12:08:17 INFO: Starting service wazuh-dashboard.
30/05/2022 12:08:17 INFO: wazuh-dashboard service started.
30/05/2022 12:08:17 INFO: Initializing Wazuh dashboard web application.
30/05/2022 12:10:18 WARNING: Cannot connect to Wazuh dashboard.
30/05/2022 12:10:18 INFO: --- Summary ---
30/05/2022 12:10:18 INFO: When Wazuh dashboard is able to connect to your Wazuh indexer cluster, you can access the web interface https://172.31.4.239
    User: admin
    Password: gJJEK64EjoVg8TKK8KlhTHbeCYwdQoNX
30/05/2022 12:10:18 INFO: Installation finished.
  • With nodes up and cluster started
[root@ip-172-31-4-239 ec2-user]# bash wazuh-install.sh --wazuh-dashboard dashboard 
30/05/2022 12:12:00 INFO: Starting Wazuh installation assistant. Wazuh version: 4.3.0
30/05/2022 12:12:00 INFO: Verbose logging redirected to /var/log/wazuh-install.log
30/05/2022 12:12:05 INFO: Wazuh repository added.
30/05/2022 12:12:06 INFO: --- Wazuh dashboard ----
30/05/2022 12:12:06 INFO: Checking if Wazuh indexer nodes are active.
30/05/2022 12:12:06 INFO: Starting Wazuh dashboard installation.
30/05/2022 12:13:05 INFO: Wazuh dashboard installation finished.
30/05/2022 12:13:05 INFO: Wazuh dashboard post-install configuration finished.
30/05/2022 12:13:14 INFO: Starting service wazuh-dashboard.
30/05/2022 12:13:15 INFO: wazuh-dashboard service started.
30/05/2022 12:13:15 INFO: Initializing Wazuh dashboard web application.
30/05/2022 12:13:26 INFO: Wazuh dashboard web application initialized.
30/05/2022 12:13:26 INFO: --- Summary ---
30/05/2022 12:13:26 INFO: You can access the web interface https://172.31.4.239
    User: admin
    Password: gJJEK64EjoVg8TKK8KlhTHbeCYwdQoNX
30/05/2022 12:13:26 INFO: Installation finished.

@rauldpm
Copy link
Member

rauldpm commented Jun 2, 2022

Please, update your branch with the correct Wazuh version in the install tests. See related CI checks

Copy link
Contributor

@DFolchA DFolchA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

Check if indexer nodes are actives before installing wazuh dashboard
4 participants