wazuh-packages icon indicating copy to clipboard operation
wazuh-packages copied to clipboard

Check if indexer nodes are active before installing the dashboard

Open miguelfdez99 opened this issue 2 years ago • 1 comments

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.

miguelfdez99 avatar May 30 '22 12:05 miguelfdez99

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

rauldpm avatar Jun 02 '22 15:06 rauldpm