Outdated Version

You are viewing an older version of this section. View current production version.

Configure Components min read


Kafka

Info

If you don’t have an <org-name> when creating the two new Kafka topics and you’re configuring for AWS, then the <org-name> will be provided to you by a MemSQL representative.

If you’re installing for on-premises, then you must create your own <org-name>.

  1. If a Kafka cluster is not already available, install Kafka on the collecting Master Aggregator host.

  2. Create a new “<org-name>_metrics” Kafka topic, replacing <org-name> with your organization’s name, such as myorg_metrics.

    Replace <zookeeper-host>:<zookeeper-port> with the values of your Kafka configuration.

    ~/kafka/bin/kafka-topics.sh --create --zookeeper <zookeeper-host>:<zookeeper-port> --replication-factor 1 --partitions 1 --topic <org-name>_metrics
    ****
    WARNING: Due to limitations in metric names, topics with a period ('.') or underscore ('_') could collide. To avoid issues it is best to use either, but not both.
    Created topic "<org-name>_metrics".
    
  3. Create a new “<org-name>_blobs” Kafka topic, replacing <org-name> with your organization’s name, such as myorg_blobs.

    Replace <zookeeper-host>:<zookeeper-port> with the values of your Kafka configuration.

    ~/kafka/bin/kafka-topics.sh --create --zookeeper <zookeeper-host>:<zookeeper-port> --replication-factor 1 --partitions 1 --topic <org-name>_blobs
    ****
    WARNING: Due to limitations in metric names, topics with a period ('.') or underscore ('_') could collide. To avoid issues it is best to use either, but not both.
    Created topic "<org-name>_blobs".
    
  4. Optional: Enable security for both of these topics using SASL for username and password encryption and SSL for encryption over the wire.

  5. Confirm that all Kafka brokers are accessible from all hosts in the monitored MemSQL cluster, and that the Kafka broker can be accessed from the collecting Master Aggregator host.

    Potential sources of issues can include improperly defined AWS security groups, iptables, and/or firewall settings.

    For each host in the cluster, attempt to telnet to the Kafka broker. Press Ctrl-C (^C) to close the connection.

    telnet <kafka-broker-host> <kafka-broker-port>
    ****
    Connected to xxx.xxx.xxx.xxx.
    Escape character is '^]'.
    ^CConnection closed by foreign host
    

Grafana

  1. If a Grafana instance is not already available, install Grafana on the collecting Master Aggregator host.

  2. Add the Grafana pie chart panel.

    sudo grafana-cli plugins install grafana-piechart-panel
    
  3. Restart the Grafana server.

    sudo systemctl restart grafana-server
    
  4. Add the Grafana multi-bar graph panel.

    sudo grafana-cli --pluginUrl https://github.com/CorpGlory/grafana-multibar-graph-panel/archive/0.2.5.zip plugins install multibar-graph-panel
    
  5. Restart the Grafana server.

    sudo systemctl restart grafana-server
    

memsql_exporter

The memsql_exporter is a satellite process that collects data about a running cluster and funnels it to either memsql_pusher or to a Prometheus process which pulls from the memsql_exporter and sends it to a Kafka queue.

The memsql_exporter binary typically resides in /opt/memsql-server-<version>/memsql_exporter.

Note: Perform the following steps on the monitored Master Aggregator.

  1. Confirm that the memsql_exporter exists in /usr/bin/.

    ls /usr/bin/memsql_exporter
    ****
    /usr/bin/memsql_exporter
    
  2. If not, create a symbolic link (“symlink”) in /usr/bin/ that points to memsql_exporter.

    cd /usr/bin
    
    sudo ln -s /opt/memsql-server-<version>/memsql_exporter/memsql_exporter memsql_exporter
    
  3. Test the memsql_exporter symlink.

    memsql_exporter --help
    
  4. Confirm that the memsql_exporter.cnf file exists in /etc/memsql/. This file describes the address and the user with which memsql_exporter will login and query the cluster.

    ls /etc/memsql/memsql_exporter.cnf 
    ****
    /etc/memsql/memsql_exporter.cnf
    
  5. If not, copy it to the /etc/memsql directory.

    sudo cp /opt/memsql-server-<version>/memsql_exporter/conf/memsql_exporter.cnf /etc/memsql/
    
  6. Modify the /etc/memsql/memsql_exporter.cnf file by removing the last two [client] sections and adding the MemSQL password.

    [client]
    host=localhost
    port=3306
    user=root
    password=<password, blank if none>
    database=information_schema
    
  7. Copy the memsql_exporter_ma.args file to the /etc/memsql directory. This file contains parameters for memsql_exporter that can be used to enable or disable specific functions.

    sudo cp /opt/memsql-server-<version>/memsql_exporter/conf/memsql_exporter_ma.args /etc/memsql/
    
  8. Start memsql_exporter.

    sudo /usr/bin/memsql_exporter @/etc/memsql/memsql_exporter_ma.args
    
  9. Optional: Create and start a memsql_exporter service by copying the memsql_exporter@.service file to /lib/systemd/system.

    sudo cp /opt/memsql-server-<version>/memsql_exporter/conf/memsql_exporter@.service /lib/systemd/system/
    
    sudo systemctl daemon-reload
    
    sudo systemctl enable memsql_exporter@ma
    ****
    Created symlink from /etc/systemd/system/multi-user.target.wants/memsql_exporter@ma.service to /usr/lib/systemd/system/memsql_exporter@.service.
    
    sudo systemctl start memsql_exporter@ma
    
  10. Confirm that memsql_exporter is running.

    ps -aux | grep memsql_exporter
    ****
    memsql    22678  0.1  0.0  14088  4588 ?        Ssl  15:30   0:00 /usr/bin/memsql_exporter @/etc/memsql/memsql_exporter_ma.args
    

memsql_pusher

The memsql_pusher is a satellite process that takes input from one or more exporters (such as memsql_exporter or other Prometheus ecosystem tools), processes it, and sends the collected data to the <org-name>_metrics and <org-name>_blobs Kafka topics created earlier. The <org-name> prefix is your organization’s name.

Note: Perform the following steps on the monitored Master Aggregator.

  1. Merge the /etc/memsql/memsql_pusher.args file with the entries below, substituting the values for your MemSQL configuration.

    --cluster.name=<analytics-cluster-name>
    --org=<org-name>
    --monitor.hosts=localhost
    --kafka.bootstrap=<kafka-broker-host>:<kafka-port>
    --kafka.protocol=plaintext
    

    Note: The --org=<org-name> parameter must match the topic prefix created earlier.

  2. Start memsql_pusher.

    sudo memsql_pusher @/etc/memsql/memsql_pusher.args
    
  3. Optional: For MemSQL v7.0.10 and later, create and start a memsql_pusher service by copying the memsql_pusher.service file to /lib/systemd/system. There is no memsql_pusher service for MemSQL v7.0.9 and earlier.

    sudo cp /opt/memsql-server-<version>/memsql_exporter/conf/memsql_pusher.service /lib/systemd/system/
    
    sudo systemctl daemon-reload
    
    sudo systemctl enable memsql_pusher
    ****
    Created symlink from /etc/systemd/system/multi-user.target.wants/memsql_pusher.service to /usr/lib/systemd/system/memsql_pusher.service.
    
    sudo systemctl start memsql_pusher
    
  4. Confirm that memsql_pusher is running.

    ps -aux | grep memsql_pusher
    ****
    memsql    23083  2.5  0.1 688912 18860 ?        Ssl  15:41   0:00 /usr/bin/memsql_pusher @/etc/memsql/memsql_pusher.args