Unable to start HeartBeat

(Luke) #1

Hi I am new on this and starting to configure this feature. Unfortunately I am facing some difficulties getting the module to work.

When executing : systemctl start heartbeat
Results: Failed to start heartbeat.service: Unit heartbeat.service not found.

When executing : service heartbeat start
Result: Failed to start LBS: High-availability services

Please guide, thanks

(David Pilato) #2

How did you install it?

(Luke) #3

Hi I used apt-get install heartbeat-elastic to install it, and followed by update-rc.d heartbeat-elastic defaults 95 10.

When I try to start the systemctl start heartbeat.service it shows me the following error:
Failed to start LSB: High-availability services.....

(David Pilato) #4

Ok. I don't know but I'm moving the question to #beats:heartbeat

(Martin R.) #5

Hi,

Welcome to the club of people who stare at the screen for 3 seconds every time they toy with heartbeat package/service and initially get a problem until they remember... :slight_smile:

Funny story actually:

I don't use deb packages, but use "heartbeat-elastic" for the service name. That's the right name everywhere, except where it isn't like the binary itself.

This is a useful read to hopefully burn it into your brain enough so that it only takes 3 seconds of starring when you hit this again in six months. I promise, it's a only a very small annoyance once in a while in exchange for a very cool name :slight_smile:

I believe this page is simply wrong, I guess even the people at Elastic get confused sometimes? Or they use variables to build part of the doc:
https://www.elastic.co/guide/en/beats/heartbeat/7.0/running-with-systemd.html

Do you want to open an issue for what I think is bad doc above and reference this thread? Let me know if you can.

(Luke) #6

Hi may I know what is "LSB: High-availability services"? Currently I have this error on my log.

Secondly, may I know how can I connect the data to ES?

(Martin R.) #7

http://linux-ha.org/wiki/Heartbeat
Another completely unrelated software called heartbeat which you are attempting to start by error. The heartbeat software by Elastic has a service name of « heartbeat-elastic » and not « heartbeat ».

Your second question I don’t understand. You have to configure an output in the output section of the config file to ship events to Elasticsearch, that is documented here:
https://www.elastic.co/guide/en/beats/heartbeat/current/elasticsearch-output.html
Can you be more specific?

(Luke) #8

Hi, I think the one I installed using apt is correct, its Heartbeat-elastic. In the directory, there are fields.yml, heartbeat.reference.yml, monitor .yml and monitos.d.

How am I able to verify this is truly correct?

Secondly, why is there "heartbeat.reference.yml and heartbeat.yml.? What are the differences?

(Luke) #9

Dear all, I also found that there is this problem, which user should I grant to and what access do I need to grant?

(Martin R.) #10

Dude, you're still interacting with "heartbeat" instead of "heartbeat-elastic".
Stop doing

service heartbeat start

or

systemctl start heartbeat

Whatever you do, do it with "heartbeat-elastic".

The error you posted is from the heartbeat software and not the heartbeat-elastic software.
You installed it correctly, "heartbeat-elastic" and you go to the right directory to see the config files but you keep interacting with the wrong service/daemon/systemd unit file.

(Martin R.) #11

Sorry for calling you “dude”, not cool of me :sweat_smile:

(Luke) #12

Hi Martin, I realized there are 2 directories, one is /usr/share/heartbeat & the other one is /etc/heartbeat. May I know which is the correct one? Thanks

So this heartbeat and heartbeat-elastic has nothing to do with each other?

(Luke) #13

Hi Martin, is this looks more correct?

(Martin R.) #14

Both are correct. Software files are installed in multiple directories according to what type of files they are. Binaries and config files are installed in different directories and all that is fine. Thats normal.

Indeed the linux-ha heartbeat software has nothing to do with Elastic hearbeat-elastic software. Same as if 2 companies had made a game and both called it “Solitaire”. It could be confusing once both are installed in your system and your start looking at everything named “solitaire” in your machine. The situation is similar.

I still think your system is in a good state if all you did so far is install heartbeat-elastic from the DEB package. Just remember that the package name AND the Service name is heartbeat-elastic. So edit the config file /etc/heartbeat/heartbeat.yml and interact with the service/daemon via the name heartbeat-elastic when you use the “service” command or the “systemctl” command, whichever you use on your system normally.

(Martin R.) #15

Yes your interacting with the right daemon now.
If you want to know why it’s failing, you need to check the logs.
I can’t tell you where they are because I don’t know which version of heartbeat-elastic you installed.
The logs will be either in /var/log/heartbeat/heartbeat
or they will be in in journald and you should be able to check them with the following command:
journalctl -u heartbeat-elastic.service

Do share which version you installed.

(Luke) #16

Martin, do you know what is this error referring to? Is it because logstash cannot connect through the correct port 5044?

(Luke) #17

The version that I am having it now is 7.0.1.

(Martin R.) #18

There is actually no information about the cause of the failure to start in those systemd events.
As I said above you need to look in the logs to investigate the cause of the failure to start which is most probably a problem with the config you have in the config file. That's because "just" failing to ship the events out to the configured output, either logstash or ES does not prevent the service from starting.

Look at the logs.

Also please dont use images to share logs, terminal outputs or config files. Format it properly as text and use the </> button to mark it from the post editor. Or use triple backticks ``` before and after. So it looks like that and is readable.

yada yada

Since you're using version 7.0.1 on an OS using systemd, the logs should be accessible with

journalctl -u heartbeat-elastic.service
(Luke) #19

Hi Martin,

May I know in the heartbeat.yml config file, there is a field called "setup.template.name" & "path" what should I link or direct to?

(Martin R.) #20

Please share your full config file if you need help with a config file.
There are multiple path settings, I don’t know which one your asking about if I can’t see your full config file.

The other setting is probably not required at all, depending on your config. Actually maybe both settings would be best left to default.

You should start with a very basic config, close to the default config file that was delivered in heartbeat.yml. But anyhow, please share it with us if you need help.