Run influxd as a service ubuntu - EC2

I was trying to run influxdb_2.0.0-alpha.20 as a service, so every time i lunch a new instance of EC2 with terraform have provisioned influxdb

[Unit]
Description=InfluxDB 2.0 service file.
Documentation=https://v2.docs.influxdata.com/v2.0/get-started/
After=network-online.target

[Service]
User=influxdb
Group=influxdb
ExecStart=/usr/local/bin/influxd 
Restart=on-failure

[Install]
WantedBy=multi-user.target

apart from after have running that service i would use cli command to complete the auth process

influx setup
-b {bucket} \ -o {org}
-u {user}\ -p {pass}
-r -1
-t ${tocken}
-f

Is this not working? You will have to provision InfluxDB in order to get the token.

dg

hi @davidgs that services its running but when i review “http://public-ip-ec2:9999/” nothing happen, so why the way i create influxd daemon as a service no work?, another thing in terraform i opened the port 9999 for ec2 instance

My next question was going to be about ensuring that the port was open – and making sure it’s open in both directions – and then ensuring that the process is running and the port is open. Logging in to the instance and running something like netstat -nlp to see what ports are being used (look for 9999, of course) and a ps -elf | grep influx to make sure that the process is actually started, would be a start.