Host deployment

Loggie uses Golang to be compiled into binary, and can be deployed to various systems according to needs. Here we provide a reference for deploying Loggie using systemd.

Pre-check

  • Operating System: Linux
  • System Architecture: amd64
  • Distribution supports systemd

The current release only contains binary executables generated by GOOS=linux GOARCH=amd64. For other systems and architectures, please cross-compile based on the source code.

Download Binary

  1. VERSION=v1.3.0
  2. mkdir /opt/loggie && curl https://github.com/loggie-io/loggie/releases/download/${VERSION}/loggie-linux-amd64 -o /opt/loggie/loggie && chmod +x /opt/loggie/loggie

Please replace <VERSION> above with the specific version number.

Add Configuration File

Please create the configuration according to the actual needs, the following is for reference:

loggie.yml

loggie.yml

  1. cat << EOF > /opt/loggie/loggie.yml
  2. loggie:
  3. monitor:
  4. logger:
  5. period: 30s
  6. enabled: true
  7. listeners:
  8. filesource: ~
  9. filewatcher: ~
  10. reload: ~
  11. sink: ~
  12. reload:
  13. enabled: true
  14. period: 10s
  15. http:
  16. enabled: true
  17. port: 9196
  18. EOF

pipelines.yml

pipelines.yml

  1. cat << EOF > /opt/loggie/pipelines.yml
  2. pipelines:
  3. - name: local
  4. sources:
  5. - type: file
  6. name: demo
  7. paths:
  8. - /tmp/log/*.log
  9. sink:
  10. type: dev
  11. printEvents: true
  12. codec:
  13. pretty: true
  14. EOF

Add systemd Configuration

  1. cat << EOF > /lib/systemd/system/loggie.service
  2. [Unit]
  3. Description=Loggie
  4. Documentation=https://loggie-io.github.io/docs/getting-started/install/node/
  5. [Service]
  6. MemoryMax=200M
  7. ExecStart=/opt/loggie/loggie -config.system=/opt/loggie/loggie.yml -config.pipeline=/opt/loggie/pipelines.yml
  8. Restart=always
  9. [Install]
  10. WantedBy=multi-user.target
  11. EOF

Start up

Make configuration take effect

  1. systemctl daemon-reload

Then set it to start on boot:

  1. systemctl enable loggie

Then you can start Loggie:

  1. systemctl start loggie

After Loggie is started, you can check status at any time:

  1. systemctl status loggie