Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to copy files between nodes in a custom service

How to copy files between nodes in a custom service

New Contributor

Hi,

I'm developing a custom stack for ambari with some internal custom services.

I'm wondering if there is a polite way to propagate a file between the hosts where the service is intalled in the installation process.

At this moment I generate a keyring in the installation phase of a Master component. I need to copy that file to the nodes where the slave services is installed. I think that technically it is possible through the Agents.

There is a command in the framework to accompilsh to that result?

2 REPLIES 2

Re: How to copy files between nodes in a custom service

Unfortunately, Ambari does not support a feature to share files across nodes via the agent. I think others have tried something similar using Zookeeper or maybe even HDFS. However, I am not sure about any details of those other scenarios.

Another possible solution is to have a master component on the Ambari server host write the file(s) to be shared to the Ambari server's resources directory (/var/lib/ambari-server/resources/) and then have the slaves or clients pull the file(s) via HTTP calls like http://ambari.example.com:8080/resources/shared_file.

Re: How to copy files between nodes in a custom service

Expert Contributor

Althought this isn't supported by ambari, the fact that his runs as the same users as ambari, means you may have tools you need. The ambari users does run as a user that has passwordless ssh access to all nodes, this can be used to scp files to nodes. (Something I abuse a lot to move file to all servers.)