This directory provides fleet units to install SPM on CoreOS
-
- spm-agent.service starts SPM Agent for Docker on all hosts
- It takes the SPM and Logsene App Tokens and the TCP port for the logging gateway from etcd
- It starts on every CoreOS host (global unit)
-
- It forwards logs from journald to the logging gateway running as part of spm-agent-docker
- All fields stored in the journal are then available in Logsene
-
cloud-config.example.yml an example, which integrates spm-agent.service and logsene.service in a cloud config file for deployments on new cluster nodes
Read more about Centralized Log Management and Monitoring for CoreOS Clusters
- Get a free account apps.sematext.com
- Create an SPM App of type “Docker” to obtain the SPM Application Token
- Create a Logsene App to obtain the Logsene Token
- Run the install script on one of your CoreOS machines - services will be distributed to all machines via fleet
wget https://raw.githubusercontent.com/sematext/spm-agent-docker/master/coreos/install_spm.sh -O install_spm.sh
chmod +x install_spm.sh
./install_spm.sh YOUR_SPM_TOKEN YOUR_LOGSENE_TOKEN 9000
Parameters for install_spm.sh:
- SPM Token
- Logsene Token
- Port for the Logging Gateway (exposed TCP port in spm-agent) e.g. 9000
- Get a free account apps.sematext.com
- Create an SPM App of type “Docker” to obtain the SPM Application Token
- Create a Logsene App to obtain the Logsene Token
- Store the configuration in etcd, the Logsene Gateway Port is 9000 by default.
etcdctl set /sematext.com/myapp/spm/token SPM_TOKEN
etcdctl set /sematext.com/myapp/logsene/token LOGSENE_TOKEN
etcdctl set /sematext.com/myapp/logsene/gateway_port LOGSENE_GATEWAY_PORT
- Download the service files and install it with fleet
# INSTALLATION
# Download the unit file for SPM
wget https://raw.githubusercontent.com/sematext/spm-agent-docker/master/coreos/spm-agent.service -O spm-agent.service
# Start SPM Agent in the whole cluster
fleetctl load spm-agent.service
fleetctl start spm-agent.service
# Download the unit file for Logsene
wget https://raw.githubusercontent.com/sematext/spm-agent-docker/master/coreos/logsene.service -O logsene.service
# Start the log forwarding service
fleetctl load logsene.service
fleetctl start logsene.service
An example is provided here cloud-config.example.yml. Please don't forget to set the App Tokens in etcd!
etcdctl set /sematext.com/myapp/spm/token SPM_TOKEN
etcdctl set /sematext.com/myapp/logsene/token LOGSENE_TOKEN
etcdctl set /sematext.com/myapp/logsene/gateway_port LOGSENE_GATEWAY_PORT
If you see a way to improve the setup, make things easier or discovered a bug - please submit a pull request.