Rate This Document
Findability
Accuracy
Completeness
Readability

Using LoadsMetric

LoadsMetric is a cluster load collection and analysis tool. It can be installed, uninstalled, started, and stopped. In addition, it allows starting and stopping other software such as Prometheus, Node Exporter, and Grafana with one click.

Viewing Commands

  1. Go to the /home/hadoop/loadsmetric-software directory on the server1 node.
    cd /home/hadoop/loadsmetric-software
  2. Run the sh loadsmetric_deploy.sh command to view the script execution method.
    sh loadsmetric_deploy.sh

Basic Usage of LoadsMetric

You are advised to run the script in the directory where the script is stored.

1
cd /home/hadoop/loadsmetric-software/
  • Installing LoadsMetric
    1
    sh loadsmetric_deploy.sh install
    
  • Uninstalling LoadsMetric
    1
    sh loadsmetric_deploy.sh uninstall
    
  • Starting LoadsMetric
    1
    sh loadsmetric_deploy.sh start
    
  • Stopping LoadsMetric
    1
    sh loadsmetric_deploy.sh stop
    
  • Restarting LoadsMetric
    1
    sh loadsmetric_deploy.sh restart
    

LoadsMetric Log Configuration

  1. Open the log configuration file.
    1
    vi /home/hadoop/loadsmetric-install/loadsmetric-server/etc/logback.xml
    
  2. Press i to enter the insert mode and modify the following parameters:
    1
    2
    3
    4
    5
    6
    <!--LOG FILE RETENTION DAYS -->   # Set the number of days for retaining historical log files.
    <MaxHistory>30</MaxHistory>
    <!-- LOG FILE MAX SIZE -->        # Set the maximum size of an individual log file.
    <MaxFileSize>2000MB</MaxFileSize>
    <!-- LOG FILE TOTAL SIZE CAP -->    # Set the maximum drive space used to store all log files.
    <TotalSizeCap>20GB</TotalSizeCap>
    
  3. Press Esc, type :wq!, and press Enter to save the file and exit.

Starting and Stopping Prometheus, Node Exporter, and Grafana Using LoadsMetric

Table 1 describes the commands of starting and stopping Prometheus, Node Exporter, and Grafana with one click.

Table 1 Starting and stopping Prometheus, Node Exporter, and Grafana using the LoadsMetric service with one click

No.

Function

Command

Description

1

Starting Node Exporter with one click

sh loadsmetric_deploy.sh start_exporter

When the Node Exporter installation directory is the default directory /opt/prometheus/node_exporter-1.7.0.linux-arm64/, start Node Exporter on all agent nodes with one click.

sh loadsmetric_deploy.sh start_exporter "Installation_directory"

Example: sh loadsmetric_deploy.sh start_exporter "/opt/prometheus/node_exporter-1.7.0.linux-arm64"

When the Node Exporter installation directory is another directory, start Node Exporter on all agent nodes with one click.

2

Stopping Node Exporter with one click

sh loadsmetric_deploy.sh stop_exporter

Stop Node Exporter on all agent nodes with one click.

3

Starting Prometheus with one click

sh loadsmetric_deploy.sh start_prometheus

When the Prometheus installation directory is the default directory /opt/prometheus/prometheus-2.45.4.linux-arm64/, start Prometheus on the server node with one click.

sh loadsmetric_deploy.sh start_prometheus "Installation_directory"

Example: sh loadsmetric_deploy.sh start_prometheus "/opt/prometheus/prometheus-2.45.4.linux-arm64"

When the Prometheus installation directory is another directory, start Prometheus on all server nodes with one click.

4

Stopping Prometheus with one click

sh loadsmetric_deploy.sh stop_prometheus

Stop Prometheus on all server nodes with one click.

5

Starting Grafana with one click

sh loadsmetric_deploy.sh start_grafana

When the Grafana installation directory is the default directory /opt/prometheus/grafana-v10.4.2/bin/, start Grafana on all server nodes with one click.

sh loadsmetric_deploy.sh start_grafana "Installation_directory"

Example: sh loadsmetric_deploy.sh start_grafana "/opt/prometheus/grafana-v10.4.2/bin"

When the Grafana installation directory is another directory, start Grafana on all server nodes with one click.

6

Stopping Grafana with one click

sh loadsmetric_deploy.sh stop_grafana

Stop Grafana on all server nodes with one click.