Created 08-03-2017 10:47 AM
Hello,
I am following the documentation to add a custom service to the Ambari. So far, I am able to understand and create a custom service and was able to successfully add to the Ambari.
Next, I need to add the dependencies which needs to be installed prior to the custom service. For example, before deploying custom service it will install the dependencies such as SPARK, KAFKA, YARN, HDFS. For this purpose I was looking into HIVE:metainfo.xml file and could understand the below portions needs to be added in order to add the dependencies
<dependencies> <dependency> <name>ZOOKEEPER/ZOOKEEPER_SERVER</name> <scope>cluster</scope> <auto-deploy> <enabled>true</enabled> <co-locate>HIVE/HIVE_SERVER</co-locate> </auto-deploy> </dependency> <dependency> <name>YARN/YARN_CLIENT</name> <scope>host</scope> <auto-deploy> <enabled>true</enabled> </auto-deploy> </dependency> <dependency> <name>MAPREDUCE2/MAPREDUCE2_CLIENT</name> <scope>host</scope> <auto-deploy> <enabled>true</enabled> </auto-deploy> </dependency> </dependencies> <requiredServices> <service>ZOOKEEPER</service> <service>YARN</service> <service>TEZ</service> </requiredServices>
However, there are some aspects I could not find and was not able to understand about the "dependency". So, I would like to know about:
<dependency> <name>ZOOKEEPER/ZOOKEEPER_SERVER</name> [How this naming are put ?] <scope>cluster</scope> [When to use which scope ?] <auto-deploy> <enabled>true</enabled> <co-locate>HIVE/HIVE_SERVER</co-locate> </auto-deploy> </dependency>
Thank you !
Created 08-03-2017 01:58 PM
@1. you already linked to the resources handling custom services, maybe the sub-menu brings more light
@2. depdency.name: this is <Service>/<Component>, have a look at the other metainfo.xml definitions. As another example, if you depend on an HBase Master you would write HBASE/HBASE_MASTER
@2 dependency.scope: this is the scope the dependency has to have. In your example, 'cluster' means that a Zookeeper Server has to be installed somewhere on your cluster. When you have scope 'host' it would mean that the component Zookeeper Server has to be on the same host as your custom service.
Hope that helps.
Created 08-03-2017 01:58 PM
@1. you already linked to the resources handling custom services, maybe the sub-menu brings more light
@2. depdency.name: this is <Service>/<Component>, have a look at the other metainfo.xml definitions. As another example, if you depend on an HBase Master you would write HBASE/HBASE_MASTER
@2 dependency.scope: this is the scope the dependency has to have. In your example, 'cluster' means that a Zookeeper Server has to be installed somewhere on your cluster. When you have scope 'host' it would mean that the component Zookeeper Server has to be on the same host as your custom service.
Hope that helps.
Created 08-09-2017 11:57 AM
Thank you David Pocivalnik !
I have one more question. Maybe it is a bit dumb question but suppose, i have couple of component for example there's Master, Slave components. How will I know, to which component type to add the dependencies ?
Created 08-09-2017 12:24 PM
I don't know of any best practice, but I did refer to an existing service, e.g. HBase
This example shows that the dependencies are only defined for the Master component. But anyhow, it totally depends on your components. So if your slave depends on having e.g. a RegionServer on the same host you should add this dependency to your slave component. If you just require to have a RegionServer on the cluster I'd just go with defining the dependency at the Master component.
What's also important is the '<requiredServices>' section in the sample linked to above.
I hope this information helps.