Step 8: Configure Prometheus to scrape metrics Jul 27 02:11:05 systemd: Failed at step EXEC spawning /usr/sbin/node_exporter: No such file or directory cp /home/node_exporter/node_exporter/node_exporter /usr/sbin/ Jul 27 02:11:05 systemd: Starting Node Exporter. Jul 27 02:11:05 systemd: Started Node Exporter. You should have copy the binary to /usr/sbin/ location. Once you created the service file, you can start the process: sudo systemctl start node_rvice Here also we are passing the node_exporter options through this file “/etc/sysconfig/node_exporter” Step 7: Start the process & rm -r $LOCKFILE & success || failureĮcho "Usage: $0 " Nohup $EXEC $OPTIONS > $LOGFILE 2> $ErrLOGFILE & If thenĮcho "/etc/rc.d/init.d/functions is not exists" OPTIONS=`cat /etc/sysconfig/node_exporter`ĮrrLOGFILE=/var/log/node_exporter_error.log File: /etc/init.d/node_exporterĬommand: sudo service node_exporter status|stop|start #!/bin/bash If you are using CentOS 6 init based server, you can use the below script for managing node_exporter as a service. OPTIONS="-collector.nfs -log.level='fatal'" Like, if you want to disable few metric set or enable more metric sets, you can manage through this file. ĮnvironmentFile=/etc/sysconfig/node_exporterĮxecStart=/usr/sbin/node_exporter $OPTIONSĬreate /etc/sysconfig/node_exporter and you can add your node_exporter binary’s environment variables through this file. So we need a service file to manage the process.Ĭreate a file /etc/systemd/system/node_rvice with following content. We have run the process in background as a daemon. Now we just startup the process in foreground. X.x.x.x -> Is the Prometheus server IP address Step 6: Create a service file If you are using CentOS 6 server: iptables -A INPUT -i eth0 -p tcp -s x.x.x.x -dport 9100 -m state -state NEW -j ACCEPT If you are using CentOS 7 server: firewall-cmd -add-port=9100/tcp You have to open port 9100 for your Prometheus servers, so that the Prometheus can scrape the data from node_exporter. Once you start the process you can check the connectivity from your Prometheus server on port number 9100 Step 5: Enable 9100 for your Prometheus server. Now the node_exporter process is up and listening on its default port 9100. Mv node_exporter-0.16.0-rc.1.linux-amd64 node_exporter Step 4: Start the node_exporter process. 01:28:08 (173 KB/s) - ‘node_exporter-0.16.0-rc.1.’ saved Step 3: Extract the node_exporter package and rename the directory to ‘node_exporter’ for your convenience. Wget HTTP request sent, awaiting response. Grafana node exporter download#useradd -m -s /bin/bash node_exporter Step 2: Log into node_exporter user and download the latest node_exporter package. Create a system user for the installation. Grafana node exporter install#Just download the tar, extract and run that’s it! Please do follow the steps below to install node_exporter for collecting system metrics:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |