# Metricbeat 6.8.3 service on CentOS 7 failing to start automatically on reboot

**URL:** <https://discuss.elastic.co/t/metricbeat-6-8-3-service-on-centos-7-failing-to-start-automatically-on-reboot/205232>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [October 25, 2019, 10:16am UTC](https://discuss.elastic.co/t/metricbeat-6-8-3-service-on-centos-7-failing-to-start-automatically-on-reboot/205232 "2019-10-25T10:16:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohit\_Kunjir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohit_kunjir/32/56602_2.png) [@Mohit\_Kunjir](https://discuss.elastic.co/u/Mohit_Kunjir)\
**Post date:** [October 25, 2019, 10:16am UTC](https://discuss.elastic.co/t/metricbeat-6-8-3-service-on-centos-7-failing-to-start-automatically-on-reboot/205232/1 "2019-10-25T10:16:27Z")

</div>

This is my metricbeat.yml file

```
name: Metricbeat-Monitor

#================================= Paths ============================

path.home: /usr/share/metricbeat

path.config: /etc/metricbeat

path.data: /var/lib/metricbeat

path.logs: /var/log/metricbeat

#========================== Modules configuration ========================

metricbeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: true

  # Period on which files under path should be checked for changes
  reload.period: 10s

#========================== Metricbeat Modules =========================

metricbeat.modules:

#---------------------------- Elasticsearch Module ---------------------------
- module: elasticsearch
  enabled: true
  metricsets:
      - ccr
      - cluster_stats
      - index
      - index_recovery
      - index_summary
      - ml_job
      - node_stats
      - shard
  period: 10s
  hosts: ["https://elasticsearch-master-vm0:9200","https://elasticsearch-data-vm0:9200","https://elasticsearch-data-vm1:9200","https://elasticsearch-ingest-vm0:9200"]
  username: "beats_system"
  password: " ********"

  ssl.certificate_authorities: ["/etc/metricbeat/certs/elasticsearch-master-vm0/ca.crt"]
  index_recovery.active_only: false
  xpack.enabled: true

#------------------------------- Kibana Module -------------------------------
- module: kibana
  metricsets: ["stats"]
  period: 10s
  hosts: ["https://portal.xorsoc.com:443"]
  ssl.certificate_authorities: ["/etc/metricbeat/certs/kibana-vm0/ca.crt"]
  ssl.certificate: "/etc/metricbeat/certs/kibana-vm0/instance.crt"
  ssl.key: "/etc/metricbeat/certs/kibana-vm0/instance.key"
  username: "kibana"
  password: " *******"
  basepath: ""
  enabled: true
  xpack.enabled: true

#================================ Processors =========================
processors:
- add_host_metadata:
   netinfo.enabled: false
#================================ Outputs ======================================

# Configure what output to use when sending the data collected by the beat.

#-------------------------- Elasticsearch output -------------------------------
output.elasticsearch:
  # Boolean flag to enable or disable the output module.
  enabled: true

  hosts: ["https://monitoring-elasticsearch-client-vm0:9200"]
  protocol: "https"
  username: "beats-system"
  password: " ********"
  worker: 1
  ssl.enabled: true
  ssl.verification_mode: none
  ssl.certificate_authorities: ["/etc/metricbeat/certs/monitoring-elasticsearch-client-vm0/ca.crt"]
  ssl.certificate: "/etc/metricbeat/certs/monitoring-elasticsearch-client-vm0/instance.crt"
  ssl.key: "/etc/metricbeat/certs/monitoring-elasticsearch-client-vm0/instance.key"
  
#================================ Logging ===============================

logging.level: info

logging.to_files: true
logging.files:

  path: /var/log/metricbeat
  name: metricbeat
  keepfiles: 1
  permissions: 0600

setup.dashboards.enabled: false
setup.template.enabled: false
setup.kibana.enabled: false

xpack.monitoring.enabled: true

```

and this is what I get when the command `sudo systemctl status metricbeat.service` is executed:

```
● metricbeat.service - Metricbeat is a lightweight shipper for metrics.
   Loaded: loaded (/usr/lib/systemd/system/metricbeat.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Fri 2019-10-25 10:00:01 UTC; 3s ago
     Docs: https://www.elastic.co/products/beats/metricbeat
  Process: 8289 ExecStart=/usr/share/metricbeat/bin/metricbeat -c /etc/metricbeat/metricbeat.yml -path.home /usr/share/metricbeat -path.config /etc/metricbeat -path.data /var/lib/metricbeat -path.logs /var/log/metricbeat (code=exited, status=1/FAILURE)
 Main PID: 8289 (code=exited, status=1/FAILURE)

Oct 25 10:00:01 fouroneone-vm0 systemd[1]: metricbeat.service: main process exited, code=exited, status=1/FAILURE
Oct 25 10:00:01 fouroneone-vm0 systemd[1]: Unit metricbeat.service entered failed state.
Oct 25 10:00:01 fouroneone-vm0 systemd[1]: metricbeat.service failed.
Oct 25 10:00:01 fouroneone-vm0 systemd[1]: metricbeat.service holdoff time over, scheduling restart.
Oct 25 10:00:01 fouroneone-vm0 systemd[1]: Stopped Metricbeat is a lightweight shipper for metrics..
Oct 25 10:00:01 fouroneone-vm0 systemd[1]: start request repeated too quickly for metricbeat.service
Oct 25 10:00:01 fouroneone-vm0 systemd[1]: Failed to start Metricbeat is a lightweight shipper for metrics..
Oct 25 10:00:01 fouroneone-vm0 systemd[1]: Unit metricbeat.service entered failed state.
Oct 25 10:00:01 fouroneone-vm0 systemd[1]: metricbeat.service failed.

```

No log files are created when metricbeat is run as service.

Metricbeat, however, works fine when invoked from CLI by the command: `./metricbeat -e -c /etc/metricbeat/metricbeat.yml`  
It also logs its event properly in `/var/log/metricbeat/metricbeat`

- I have disabled dashboard, template and kibana setup.
- I have attempted to start metricbeat manually (using `sudo systemctl start metricbeat.service` ) after the network is up and running, still getting the above error
- All I want is metricbeat to start automatically on boot.

---

<div class="post-metadata">

**Author:** ![pmercado](https://avatars.discourse-cdn.com/v4/letter/p/59ef9b/32.png) [@pmercado](https://discuss.elastic.co/u/pmercado)\
**Post date:** [October 25, 2019, 2:09pm UTC](https://discuss.elastic.co/t/metricbeat-6-8-3-service-on-centos-7-failing-to-start-automatically-on-reboot/205232/2 "2019-10-25T14:09:59Z")

</div>

is `journalctl` showing any clue?

---

<div class="post-metadata">

**Author:** ![Mohit\_Kunjir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohit_kunjir/32/56602_2.png) [@Mohit\_Kunjir](https://discuss.elastic.co/u/Mohit_Kunjir)\
**Post date:** [October 25, 2019, 5:15pm UTC](https://discuss.elastic.co/t/metricbeat-6-8-3-service-on-centos-7-failing-to-start-automatically-on-reboot/205232/3 "2019-10-25T17:15:12Z")

</div>

upon executing the command `sudo journalctl -u metricbeat` following error was shown:

`Exiting: error loading config file: config file ("/etc/metricbeat/metricbeat.yml") must be owned by the beat user or root`

Classic file ownership problem, solved by giving appropriate permissions to all the files and directories in `/etc/metricbeat/`

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 22, 2019, 5:15pm UTC](https://discuss.elastic.co/t/metricbeat-6-8-3-service-on-centos-7-failing-to-start-automatically-on-reboot/205232/4 "2019-11-22T17:15:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
