cancel
Showing results for 
Search instead for 
Did you mean: 

EFM Lock file for cluster efm has been removed

Failover Manager creates a file named <cluster-name>.lock at the location mentioned in lock.dir property (deafult 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 efm.lock.


Test case:-

1) Start the EFM agent for cluster "efm", started successfully.

[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]

[root@hostname efm-3.2]# vi /var/log/efm-3.2/startup-efm.log
You can find the below lines in the log files

[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 same
cluster 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: Please note that it is not recommended and also not a good practice to tamper with the default files generated by EFM.

Version history
Revision #:
6 of 7
Last update:
‎03-24-2019 03:20 PM
Updated by:
 
Labels (5)
Contributors
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]