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

doc: add user creation to quickstart #3271

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 35 additions & 17 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Welcome to the NetApp Harvest Getting Started Guide. This tutorial will guide you through the steps required to deploy an instance of NetApp Harvest, Prometheus, and Grafana on a Linux platform to monitor an ONTAP cluster.

This tutorial uses `systemd` to manage Harvest, Prometheus, and Grafana. If you would rather, run the processes directly, feel free to ignore the sections of the tutorial that setup `systemd` service files.
If you prefer to use the container version of NetApp Harvest, please refer to the [container installation guide](install/containers.md).

This tutorial uses `systemd` to manage Harvest, Prometheus, and Grafana. If you would rather run the processes directly, feel free to ignore the sections of the tutorial that set up `systemd` service files.

### 1. Set Installation Path

Expand All @@ -11,25 +13,40 @@ HARVEST_INSTALL_PATH=/opt/netapp/harvest
mkdir -p ${HARVEST_INSTALL_PATH}
```

### 2. Install Harvest
### 2. Create Harvest User and Group

Create a dedicated user and group for running Harvest services.

```bash
sudo groupadd harvest
sudo useradd -r -g harvest harvest
```

### 3. Install Harvest

Harvest is distributed as a container, native tarball, and RPM and Debs. Pick the one that works best for you.
More details can be found in the [installation](https://netapp.github.io/harvest/latest/install/overview/) documentation.

For this guide, we'll use the tarball package as an example.

Visit the releases page and take note of the latest release. Update the `HARVEST_VERSION` environment variable with the latest release in the script below. For example, to download the `24.05.2` release you would use `HARVEST_VERSION=24.05.2`
Visit the releases page and take note of the latest release. Update the `HARVEST_VERSION` environment variable with the latest release in the script below. For example, to download the `24.11.0` release you would use `HARVEST_VERSION=24.11.0`.

After updating the `HARVEST_VERSION` environment variable run the bash script to download Harvest and untar it into your `HARVEST_INSTALL_PATH` directory.
After updating the `HARVEST_VERSION` environment variable, run the bash script to download Harvest and untar it into your `HARVEST_INSTALL_PATH` directory.

```bash
HARVEST_VERSION=24.05.2
HARVEST_VERSION=24.11.0
cd ${HARVEST_INSTALL_PATH}
wget https://github.com/NetApp/harvest/releases/download/v${HARVEST_VERSION}/harvest-${HARVEST_VERSION}-1_linux_amd64.tar.gz
tar -xvf harvest-${HARVEST_VERSION}-1_linux_amd64.tar.gz
```

### 3. Install Prometheus
Change ownership of the files to the `harvest` user and group:

```bash
sudo chown -R harvest:harvest ${HARVEST_INSTALL_PATH}
```

### 4. Install Prometheus

To install Prometheus, follow these steps. For more details see [Prometheus installation](https://prometheus.io/docs/prometheus/latest/installation/).

Expand All @@ -40,6 +57,7 @@ wget https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VE
tar -xvf prometheus-${PROMETHEUS_VERSION}.linux-amd64.tar.gz
mv prometheus-${PROMETHEUS_VERSION}.linux-amd64 prometheus-${PROMETHEUS_VERSION}
```

If you want to manage Prometheus with `systemd`, you can create a service file for Prometheus like so. This step is optional.
A service file will attempt to restart Prometheus automatically when the machine is restarted.

Expand Down Expand Up @@ -91,7 +109,7 @@ You should see output indicating that the Prometheus service is active and runni

</details>

### 4. Install Grafana
### 5. Install Grafana

To install Grafana, follow these steps:

Expand Down Expand Up @@ -153,8 +171,7 @@ You should see output indicating that the Grafana service is active and running.

</details>


### 5. Configuration File
### 6. Configuration File

By default, Harvest loads its configuration information from the `./harvest.yml` file.
If you would rather use a different file, use the `--config` command line argument flag to specify the path to your config file.
Expand All @@ -168,7 +185,7 @@ Edit the Harvest configuration file:

```sh
cd ${HARVEST_INSTALL_PATH}/harvest-${HARVEST_VERSION}-1_linux_amd64
vi harvest.yml
sudo -u harvest vi harvest.yml
```

Copy and paste the following YAML configuration into your editor and update the `$cluster-management-ip`, `$username`, and `$password` sections to match your ONTAP system.
Expand Down Expand Up @@ -201,7 +218,7 @@ Pollers:

**Note:** The ONTAP user specified in this configuration must have the appropriate permissions as outlined in the [Prepare cDot Clusters](prepare-cdot-clusters.md) documentation.

### 6. Edit Prometheus Config File
### 7. Edit Prometheus Config File

Edit the Prometheus configuration file:

Expand Down Expand Up @@ -232,7 +249,7 @@ Check if Prometheus is up and running:
sudo systemctl status prometheus
```

### 7. Start Harvest
### 8. Start Harvest

To start the Harvest pollers, follow these steps. For more details see [Harvest service](https://github.com/NetApp/harvest/blob/main/service/contrib/README.md).

Expand All @@ -251,6 +268,7 @@ User=harvest
Group=harvest
Type=simple
Restart=on-failure
WorkingDirectory=${HARVEST_INSTALL_PATH}/harvest-${HARVEST_VERSION}-1_linux_amd64
ExecStart=${HARVEST_INSTALL_PATH}/harvest-${HARVEST_VERSION}-1_linux_amd64/bin/harvest --config ${HARVEST_INSTALL_PATH}/harvest-${HARVEST_VERSION}-1_linux_amd64/harvest.yml start -f %i

[Install]
Expand Down Expand Up @@ -303,10 +321,10 @@ systemctl status "poller*"
DC-01 | jamaica | 1280145 | 13000 | running
```

<p>The <a href="https://netapp.github.io/harvest/latest/help/log-collection/">logs</a> of each poller can be found in <code>/var/log/harvest/</code>.</p>
<p>The <a href="https://netapp.github.io/harvest/latest/help/log-collection/">logs</a> of each poller can be found in <code>/var/log/harvest/</code>.</p>
</details>

### 8. Add Prometheus Datasource in Grafana
### 9. Add Prometheus Datasource in Grafana

To add a Prometheus datasource in Grafana, follow these steps:

Expand All @@ -319,7 +337,7 @@ To add a Prometheus datasource in Grafana, follow these steps:
7. At the bottom of the page, you should see the message 'Successfully queried the Prometheus API.'
For detailed instructions, please refer to the [configure Prometheus Data Source documentation](https://grafana.com/docs/grafana/latest/datasources/prometheus/configure-prometheus-data-source/).

### 9. Generate Grafana API Token
### 10. Generate Grafana API Token

To import Grafana dashboards using the `bin/harvest grafana import` command, you need a Grafana API token. Follow these steps to generate it:

Expand All @@ -338,7 +356,7 @@ To import Grafana dashboards using the `bin/harvest grafana import` command, you

For detailed instructions, please refer to the [Grafana API Keys documentation](https://grafana.com/docs/grafana/latest/administration/api-keys/).

### 10. Import Grafana Dashboards
### 11. Import Grafana Dashboards

To import Grafana dashboards, use the following command:

Expand All @@ -353,7 +371,7 @@ You will be prompted to save your API key (token) for later use. Press `n` to no

After a few seconds, all the dashboards will be imported into Grafana.

### 11. Verify Dashboards in Grafana
### 12. Verify Dashboards in Grafana

After adding the Prometheus datasource, you can verify that your dashboards are correctly displaying data. Follow these steps:

Expand Down