This has been tested on Ambari 2.6.2.0 and DLM 1.1.2.0
If there is broken symlink or unwanted directory under /var/lib/ambari-server/resources on Ambari Server, you get below error while installing mpack(management pack) for Beacon service.
[root@XXXXXX ~]# ambari-server install-mpack --mpack /root/beacon-ambari-mpack-1.1.2.0-37.tar.gz --verbose
Using python /usr/bin/python
Installing management pack
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
INFO: Installing management pack /root/beacon-ambari-mpack-1.1.2.0-37.tar.gz
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
INFO: Download management pack to temp location /var/lib/ambari-server/data/tmp/beacon-ambari-mpack-1.1.2.0-37.tar.gz
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
INFO: Expand management pack at temp location /var/lib/ambari-server/data/tmp/beacon-ambari-mpack-1.1.2.0-37/
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
INFO: Stage management pack beacon-engine.mpack-1.1.0.0 to staging location /var/lib/ambari-server/resources/mpacks/beacon-engine.mpack-1.1.0.0
INFO: Processing artifact BEACON-common-services of type service-definitions in /var/lib/ambari-server/resources/mpacks/beacon-engine.mpack-1.1.0.0/common-services
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
INFO: Symlink: /var/lib/ambari-server/resources/common-services/BEACON/1.1.0
INFO: Processing artifact BEACON-addon-services of type stack-addon-service-definitions in /var/lib/ambari-server/resources/mpacks/beacon-engine.mpack-1.1.0.0/addon-services
INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
Traceback (most recent call last):
File "/usr/sbin/ambari-server.py", line 952, in <module>
mainBody()
File "/usr/sbin/ambari-server.py", line 922, in mainBody
main(options, args, parser)
File "/usr/sbin/ambari-server.py", line 874, in main
action_obj.execute()
File "/usr/sbin/ambari-server.py", line 78, in execute
self.fn(*self.args, **self.kwargs)
File "/usr/lib/ambari-server/lib/ambari_server/setupMpacks.py", line 896, in install_mpack
(mpack_metadata, mpack_name, mpack_version, mpack_staging_dir, mpack_archive_path) = _install_mpack(options, replay_mode)
File "/usr/lib/ambari-server/lib/ambari_server/setupMpacks.py", line 794, in _install_mpack
process_stack_addon_service_definitions_artifact(artifact, artifact_source_dir, options)
File "/usr/lib/ambari-server/lib/ambari_server/setupMpacks.py", line 554, in process_stack_addon_service_definitions_artifact
sudo.symlink(source_service_version_path, dest_link)
File "/usr/lib/ambari-server/lib/resource_management/core/sudo.py", line 124, in symlink
os.symlink(source, link_name)
OSError: [Errno 17] File exists
Please follow below steps to fix this:
1. Make sure that there is no backup directory under /var/lib/ambari-server/resources like common-services.backup or stacks.old etc. If exists, please move it some other location.
.
2. Delete or move below directories to other location