cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting the message, "EFM Lock file for cluster efm has been removed"?

 

EDB Failover Manager creates a file named <cluster name>.lock at the location mentioned in the lock.dir property (the default is /var/lock/efm-<version> in efm.properties) to avoid starting multiple agents for the same cluster on the same node, otherwise they would be competing for the same resources (ports, files, etc).

By default it would be named efm.lock. Removing this lock file results in the message EFM Lock file for cluster <cluster name> has been removed.

Here’s how we end up with this message:


1) Start the EFM agent for cluster "efm":

[root@hostname efm-3.2]# service efm-3.2 start
Starting local efm-3.2 service: [ OK ]


2) When you try to start it the second time, it would give error as below:

[root@hostname efm-3.2]# service efm-3.2 start
Starting local efm-3.2 service:                            [FAILED]

 

If we look in /var/log/efm-3.2/startup-efm.log, we find the following:

 

[ERROR] Unable to obtain lock file: /var/lock/efm-3.2/efm.lock
Please make sure that you don't already have an agent running on this node for cluster 'efm'.  If not, please manually delete the lock file and restart the agent.

 

 

If the lock file is deleted while the cluster is running, it won’t allow you to start another agent for same cluster, instead, you can see below message in the efm.log file:

 

Subject: [WARNING] EFM Lock file for cluster efm has been removed
Body:
EFM node:     193.268.56.169
Cluster name:  efm
Database name: edb
VIP support:   ENABLED
Auto Failover: DISABLED

 

The lock file for cluster efm has been removed from: /var/lock/efm-3.2/efm.lock on node 193.268.56.169. This lock prevents multiple agents from monitoring the samecluster on the same node. Please restore this file to prevent accidentally
starting another agent for cluster.

If the file is already deleted, it will not be possible to restore it. You need to stop/start the EFM agent.

Note that it is not recommended and also not a good practice to tamper with the default files generated by EFM.

 

Version history
Revision #:
8 of 8
Last update:
Wednesday
Updated by:
 
Labels (5)
Comments

@mohiniogale wrote:

[...]

If the file is already deleted, it will not be possible to restore it. You need to stop/start the EFM agent.


Actually, you can restore it easily, as it's just an empty file owned by 'efm' with 644 permissions named <clustername>.lock. As the 'efm' user (unless you're running in the non-sudo mode as another operating system user):

 

$ touch /var/lock/efm-3.2/efm.lock

 

That will create the file and help prevent starting multiple agents for the same cluster on the same node.

 


Note: Please note that it is not recommended and also not a good practice to tamper with the default files generated by EFM.

I'd say it's a bad idea to start removing random files from *any* running application. :)

 

Cheers,

Bobby

 

 

 

 

 

 

[comment moved]