Systemctl start grafana-server --- Fail

Hello there
I ran the following command. Its made a mistake

systemctl start grafana-server

*Job for grafana-server.service failed because the control process exited with error code. See “systemctl status grafana-server.service” and “journalctl -xe” for details.

systemctl status grafana-server
● grafana-server.service - Grafana instance
Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Çrş 2019-03-20 16:02:47 +03; 12s ago
Docs: http://docs.grafana.org
Process: 4725 ExecStart=/usr/sbin/grafana-server --config={CONF_FILE} --pidfile={PID_FILE_DIR}/grafana-server.pid --packaging=rpm cfg:default.paths.logs={LOG_DIR} cfg:default.paths.data={DATA_DIR} cfg:default.paths.plugins={PLUGINS_DIR} cfg:default.paths.provisioning={PROVISIONING_CFG_DIR} (code=exited, status=1/FAILURE)
Main PID: 4725 (code=exited, status=1/FAILURE)

Mar 20 16:02:46 localhost.localdomain systemd[1]: grafana-server.service: main process exited, code=exited, status=1/FAILURE
Mar 20 16:02:46 localhost.localdomain systemd[1]: Failed to start Grafana instance.
Mar 20 16:02:46 localhost.localdomain systemd[1]: Unit grafana-server.service entered failed state.
Mar 20 16:02:46 localhost.localdomain systemd[1]: grafana-server.service failed.
Mar 20 16:02:47 localhost.localdomain systemd[1]: grafana-server.service holdoff time over, scheduling restart.
Mar 20 16:02:47 localhost.localdomain systemd[1]: Stopped Grafana instance.
Mar 20 16:02:47 localhost.localdomain systemd[1]: start request repeated too quickly for grafana-server.service
Mar 20 16:02:47 localhost.localdomain systemd[1]: Failed to start Grafana instance.
Mar 20 16:02:47 localhost.localdomain systemd[1]: Unit grafana-server.service entered failed state.
Mar 20 16:02:47 localhost.localdomain systemd[1]: grafana-server.service failed.
[root@localhost ~]# ^C
[root@localhost ~]# nano /etc/grafana/grafana.ini
[root@localhost ~]# systemctl status grafana-server
● grafana-server.service - Grafana instance
Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Çrş 2019-03-20 16:02:47 +03; 5min ago
Docs: http://docs.grafana.org
Process: 4725 ExecStart=/usr/sbin/grafana-server --config={CONF_FILE} --pidfile={PID_FILE_DIR}/grafana-server.pid --packaging=rpm cfg:default.paths.logs={LOG_DIR} cfg:default.paths.data={DATA_DIR} cfg:default.paths.plugins={PLUGINS_DIR} cfg:default.paths.provisioning={PROVISIONING_CFG_DIR} (code=exited, status=1/FAILURE)
Main PID: 4725 (code=exited, status=1/FAILURE)

Have a look at the Grafana log, often it is /var/log/grafana/grafana.log.

LOGS;

t=2019-03-20T06:24:44+0300 lvl=info msg=“cleanup of expired auth tokens done” logger=auth count=0
t=2019-03-20T15:46:22+0300 lvl=info msg=“Shutdown started” logger=server reason=“System signal: terminated”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped UsageStatsService” logger=server reason=“context canceled”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped PluginManager” logger=server reason=“context canceled”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped CleanUpService” logger=server reason=“context canceled”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped UserAuthTokenService” logger=server reason=“context canceled”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped ProvisioningService” logger=server reason=“context canceled”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped Stream Manager”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped RenderingService” logger=server reason=nil
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped NotificationService” logger=server reason=“context canceled”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped TracingService” logger=server reason=nil
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped InternalMetricsService” logger=server reason=“context canceled”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped AlertingService” logger=server reason=“context canceled”
t=2019-03-20T15:46:22+0300 lvl=info msg=“Stopped HTTPServer” logger=server reason=nil
t=2019-03-20T15:46:22+0300 lvl=eror msg=“Server shutdown” logger=server reason=“System signal: terminated”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Starting Grafana” logger=server version=6.0.2 commit=3f4c2e7 branch=HEAD compiled=2019-03-19T16:06:06+0300
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning
t=2019-03-20T15:46:57+0300 lvl=info msg=“App mode production” logger=settings
t=2019-03-20T15:46:57+0300 lvl=info msg=“Writing PID file” logger=server path=/var/run/grafana/grafana-server.pid pid=3896
t=2019-03-20T15:46:57+0300 lvl=info msg=“Initializing HTTPServer” logger=server
t=2019-03-20T15:46:57+0300 lvl=info msg=“Initializing SqlStore” logger=server
t=2019-03-20T15:46:57+0300 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=mysql
t=2019-03-20T15:46:57+0300 lvl=info msg=“Starting DB migration” logger=migrator
t=2019-03-20T15:46:57+0300 lvl=eror msg=“Server shutdown” logger=server reason=“Service init failed: Migration failed err: dial tcp 127.0.0.1:3306: connect: connection refused”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Starting Grafana” logger=server version=6.0.2 commit=3f4c2e7 branch=HEAD compiled=2019-03-19T16:06:06+0300
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins
t=2019-03-20T15:46:57+0300 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning
t=2019-03-20T15:46:57+0300 lvl=info msg=“App mode production” logger=settings
t=2019-03-20T15:46:57+0300 lvl=info msg=“Writing PID file” logger=server path=/var/run/grafana/grafana-server.pid pid=4219
t=2019-03-20T15:46:57+0300 lvl=info msg=“Initializing HTTPServer” logger=server
t=2019-03-20T15:46:57+0300 lvl=info msg=“Initializing SqlStore” logger=server
t=2019-03-20T15:46:57+0300 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=mysql
t=2019-03-20T15:46:57+0300 lvl=info msg=“Starting DB migration” logger=migrator
t=2019-03-20T15:46:57+0300 lvl=eror msg=“Server shutdown” logger=server reason=“Service init failed: Migration failed err: dial tcp 127.0.0.1:3306: connect: connection refused”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Starting Grafana” logger=server version=6.0.2 commit=3f4c2e7 branch=HEAD compiled=2019-03-19T16:06:06+0300
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”
t=2019-03-20T15:46:57+0300 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”

That suggests that possibly your mysql server is not running.

any resolution. Since i am also facing the similar issue

telnet 127.0.0.1 3306

What is the result?

Antony.

remove grafana and make sure the grafana directory is also deleted, because it does go not by its own > then reinstall grafana , reconfigure grafana.conf server as before when it worked .

Also stop firewall completely or create an rule for port 3000 .