Kafka
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>
.
-
If a Kafka cluster is not already available, install Kafka on the collecting Master Aggregator host.
-
Create a new “<org-name>_metrics” Kafka topic, replacing
<org-name>
with your organization’s name, such asmyorg_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".
-
Create a new “<org-name>_blobs” Kafka topic, replacing
<org-name>
with your organization’s name, such asmyorg_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".
-
Optional: Enable security for both of these topics using SASL for username and password encryption and SSL for encryption over the wire.
-
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 totelnet
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
-
If a Grafana instance is not already available, install Grafana on the collecting Master Aggregator host.
-
Add the Grafana pie chart panel.
sudo grafana-cli plugins install grafana-piechart-panel
-
Restart the Grafana server.
sudo systemctl restart grafana-server
-
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
-
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.
-
Confirm that the
memsql_exporter
exists in/usr/bin/
.ls /usr/bin/memsql_exporter **** /usr/bin/memsql_exporter
-
If not, create a symbolic link (“symlink”) in
/usr/bin/
that points tomemsql_exporter
.cd /usr/bin
sudo ln -s /opt/memsql-server-<version>/memsql_exporter/memsql_exporter memsql_exporter
-
Test the
memsql_exporter
symlink.memsql_exporter --help
-
Confirm that the
memsql_exporter.cnf
file exists in/etc/memsql/
. This file describes the address and the user with whichmemsql_exporter
will login and query the cluster.ls /etc/memsql/memsql_exporter.cnf **** /etc/memsql/memsql_exporter.cnf
-
If not, copy it to the
/etc/memsql
directory.sudo cp /opt/memsql-server-<version>/memsql_exporter/conf/memsql_exporter.cnf /etc/memsql/
-
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
-
Copy the
memsql_exporter_ma.args
file to the/etc/memsql
directory. This file contains parameters formemsql_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/
-
Start
memsql_exporter
.sudo /usr/bin/memsql_exporter @/etc/memsql/memsql_exporter_ma.args
-
Optional: Create and start a
memsql_exporter
service by copying thememsql_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
-
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.
-
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. -
Start
memsql_pusher
.sudo memsql_pusher @/etc/memsql/memsql_pusher.args
-
Optional: For MemSQL v6.8.17 and later, create and start a
memsql_pusher
service by copying thememsql_pusher.service
file to/lib/systemd/system
. There is nomemsql_pusher
service for MemSQL v6.8.16 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
-
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