1

I want to deploy a custom service onto non hadoop nodes using Apache Ambari. I have created a custom service inside /var/lib/ambari-server/resources/common-services as opposed to Hadoop's folder of: /var/lib/ambari-server/resources/stacks/HDP

And then I restarted my ambari-server. But with web, I cannot see my new Service.

Am I missing anything, do I have to register my custom service anywhere?

Hi, I don’t want to hardcode my service version into metainfo.xml, Can I do it?

<service>
  <name>DUMMY_APP</name>
  <displayName>My Dummy APP</displayName>
  <comment>This is a distributed app.</comment>
  <version>0.1</version> --------------This I don't want to hardcode, Can I doit?
  <components>
  ...
  </components>
</service>
user1393608
  • 1,299
  • 3
  • 16
  • 29
  • I have 1 more question: How can I do hosts specific configuration using apache ambari? Can I do it or whatever configuration I have selected applies for all the hosts? – user1393608 Sep 01 '15 at 07:14

1 Answers1

0

You still need to specify in the stack definition that your service is available for that particular stack. Common Services is just a place to maintain a common set of service definitions which can be used as part of a stack definition through extension.

For Example, lets say you have created custom service 'MYSERVICE' with a version identifier of '1.0' and want it to be provided for the HDP 2.2 stack.

  • You would need to place your service definition at the following location:

    /var/lib/ambari-server/resources/common-services/MYSERVICE/1.0
    

    This above directory would contain your metainfo.xml file and your configuration and package folder. This will be the base definition of your service.

    Note: It is also important to note that the version you specify in /var/lib/ambari-server/resources/common-services/MYSERVICE/1.0/metainfo.xml must match the version number you have indicated in the path. For our example that would be <version>1.0</version>.

  • You will then also need to add an additional metainfo.xml file to the HDP 2.2 stack that will provide this service.

    /var/lib/ambari-server/resources/stacks/HDP/2.2/services/MYSERVICE/metainfo.xml
    

    The contents of this file would be:

    <?xml version="1.0"?>
    <metainfo>
      <schemaVersion>2.0</schemaVersion>
      <services>
        <service>
          <name>MYSERVICE</name>
          <extends>common-services/MYSERVICE/1.0</extends>
        </service>
      </services>
    </metainfo>
    
cjackson
  • 1,637
  • 1
  • 13
  • 25
  • Thanks Cjackson!!!, but then I will not be able to install my service on bare machine without hadoop? So hadoop stack version is compulsary? I just want my service to be deployed on any OS machine – user1393608 Aug 18 '15 at 05:42
  • /var/lib/ambari-server/resources/stacks/HDP is not 'Hadoops' folder. It's the Hortonworks Data Platform Stack. You could define your own stack and only list your custom service in that stack. – cjackson Aug 18 '15 at 13:05
  • Ok one more query, How can I add my custom service to web ui without having to go through installation of new cluster and adding other services? – user1393608 Aug 18 '15 at 13:33
  • Hi, I don’t want to hardcode my service version into metainfo.xml, Can I do it? DUMMY_APP My Dummy APP This is a distributed app. 0.1 ... – user1393608 Aug 26 '15 at 12:45
  • Why don't you want to hardcode it? There has to be a value there. If you explain to me why you don't want to hardcode it and what you're trying to achieve I may be able to help further. – cjackson Aug 27 '15 at 15:34
  • I don't want to hardcode the value because I want metainfo.xml version of custom service to be same as my actual product version. So when I change my product version, it should also be reflected for my custom service. – user1393608 Sep 01 '15 at 06:09
  • What build tools are you using? – cjackson Sep 01 '15 at 12:58
  • maven to build my service – user1393608 Sep 02 '15 at 06:28
  • Ask a new question about how to dynamically create the version number within the metainfo.xml file using maven build processes and I'll be happy to answer it. These comments/discussion is off track from your original question. – cjackson Sep 03 '15 at 15:12
  • Hi cjackson, I have created a new question if you could answer on that? http://stackoverflow.com/questions/32431879/dynamically-create-the-version-number-within-the-ambaris-metainfo-xml-file-usin – user1393608 Sep 22 '15 at 05:57