A distro agnostic guide to Graphite with venv (examples: RHEL8, Debian10, Ubuntu18)

Hello,

I have problem with started carbon-relay.service

[root@lmaster ~]# cat /etc/systemd/system/carbon-relay.service
[Unit]
Description=Graphite Carbon Relay
After=network.target

[Service]
Environment=PATH=/opt/graphite/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
Environment=PYTHONPATH=/opt/graphite/webapp:/opt/graphite
Environment=VIRTUAL_ENV=/opt/graphite
Type=forking
StandardOutput=syslog
StandardError=syslog
ExecStart=/opt/graphite/bin/carbon-relay.py --config=/opt/graphite/conf/carbon.conf --pidfile=/var/run/carbon-relay.pid start
ExecReload=/bin/kill -USR1 $MAINPID
PIDFile=/var/run/carbon-relay.pid
Restart=always

[Install]
WantedBy=multi-user.target


May 21 13:20:46 lmaster.localdomain systemd[1]: carbon-relay.service: Control process exited, code=exited status=1
May 21 13:20:46 lmaster.localdomain systemd[1]: carbon-relay.service: Failed with result ‘exit-code’.
May 21 13:20:46 lmaster.localdomain systemd[1]: Failed to start Graphite Carbon Relay.


I am try start directly carbon-relay.py

[root@lmaster ~]# /opt/graphite/bin/carbon-relay.py --config=/opt/graphite/conf/carbon.conf --pidfile=/var/run/carbon-relay.pid start
Removing stale pidfile /var/run/carbon-relay.pid
Starting carbon-relay (instance a)
An error has occurred: b’socket.gaierror: [Errno -2] Name or service not known’
Please look at log file for more information.


In the icinga2.log is
[2020-05-21 12:23:46 +0200] warning/GraphiteWriter: Can’t connect to Graphite on host ‘127.0.0.1’ port ‘2013.’
Context:
(0) Reconnecting to Graphite ‘graphite’

[2020-05-21 12:23:46 +0200] information/GraphiteWriter: Finished reconnecting to Graphite in 0.00087595 second(s).
[2020-05-21 12:23:46 +0200] information/IdoMysqlConnection: MySQL IDO instance id: 1 (schema version: ‘1.14.3’)
[2020-05-21 12:23:46 +0200] information/IdoMysqlConnection: Finished reconnecting to ‘ido-mysql’ database ‘icinga’ in 0.0871511 second(s).
[2020-05-21 12:23:47 +0200] critical/GraphiteWriter: Cannot write to TCP socket on host ‘127.0.0.1’ port ‘2013’.


Do you have any idea ?

Thanks
Jozef