You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Mehmet Zahid Yüzügüldü <zy...@gmail.com> on 2015/08/24 14:59:56 UTC

about apache ambari workflow

Hi guys

i make lots of  research about ambari.

i am using hadoop cluster about 2 years. HBase, Yarn Ozie, Hue and Solr.

i am trying to add some dummy skills into ambari to learn the main
architecture.

my object is to add ambari functionality that disable selinux from nodes
with the help of ambari-server and ambari-agent usage.

java spring was used to develope ambari server, i tracked some api calls
from ambari-web.

i got the url "http://node1:8080/api/v1/requests
<http://node1.b3lab.org:8080/api/v1/requests>"  with request body:

{
  "RequestInfo": {
    "action": "check_host",
    "context": "Check host",
    "parameters": {
      "check_execute_list": "host_resolution_check",
      "jdk_location": "http://node1:8080/resources/",
      "threshold": "20",
      "hosts": "node1 <http://node1.b3lab.org>"
    }
  },
  "Requests/resource_filters": [
    {
      "hosts": "node1 <http://node1.b3lab.org>"
    }
  ]
}


i found js file related with this call in
"ambari-web/app/conrtollers/wizard/step3-controller.js"

it is creating the request and calls rest api as i said :
http://node1:8080/api/v1/requests
<http://node1.b3lab.org:8080/api/v1/requests>

but i couldn't find the mapping of this rest api. i mean what service
method was fired with this rest api, i couldn't find.

after i found this, i will insert new record into db with information to
disable selinux, like script type, script name to be run etc.

i.e.
"{
   "taskId":3,
   "commandId":"2-0",
   "hostname":"node1 <http://node1.b3lab.org>",
   "role":"new_host_action",
   "hostLevelParams":{

   },
   "roleParams":{
      "check_execute_list":"disable_selinux",
      "jdk_location":"http://node1:8080/resources/",
      "threshold":"20"
   },
   "roleCommand":"ACTIONEXECUTE",
   "clusterHostInfo":{

   },
   "configurations":{

   },
   "configuration_attributes":{

   },
   "forceRefreshConfigTags":[

   ],
   "commandParams":{
      "command_timeout":"60",
      "script":"disable_selinux.py",
      "script_type":"PYTHON"
   },
   "kerberosCommandParams":[

   ],
   "commandType":"EXECUTION_COMMAND"
},"

so when *ambari-agent heardbeat*, it will get that record and will run
script to disable selinux. am i wrong?

i wonder if you could you help me to do that.

i appreciate that.

Mehmet Zahid Yüzügüldü

Re: about apache ambari workflow

Posted by Mehmet Zahid Yüzügüldü <zy...@gmail.com>.
Hi John thanks for your answer.


On Mon, Aug 24, 2015 at 7:34 PM, John Speidel <js...@hortonworks.com>
wrote:

> Mehmet,
>
> The service methods for the "requests" endpoint are contained in
> org.apache.ambari.server.api.services.RequestService.
> There are methods for GET/POST(create)/PUT(update).
> You can start ambari server in debug mode like using the command
> "ambari-server start --debug" and then use a debugger to walk through the
> server code.
>
> -John
> ________________________________________
> From: Mehmet Zahid Yüzügüldü <zy...@gmail.com>
> Sent: Monday, August 24, 2015 8:59 AM
> To: dev@ambari.apache.org
> Subject: about apache ambari workflow
>
> Hi guys
>
> i make lots of  research about ambari.
>
> i am using hadoop cluster about 2 years. HBase, Yarn Ozie, Hue and Solr.
>
> i am trying to add some dummy skills into ambari to learn the main
> architecture.
>
> my object is to add ambari functionality that disable selinux from nodes
> with the help of ambari-server and ambari-agent usage.
>
> java spring was used to develope ambari server, i tracked some api calls
> from ambari-web.
>
> i got the url "http://node1:8080/api/v1/requests
> <http://node1.b3lab.org:8080/api/v1/requests>"  with request body:
>
> {
>   "RequestInfo": {
>     "action": "check_host",
>     "context": "Check host",
>     "parameters": {
>       "check_execute_list": "host_resolution_check",
>       "jdk_location": "http://node1:8080/resources/",
>       "threshold": "20",
>       "hosts": "node1 <http://node1.b3lab.org>"
>     }
>   },
>   "Requests/resource_filters": [
>     {
>       "hosts": "node1 <http://node1.b3lab.org>"
>     }
>   ]
> }
>
>
> i found js file related with this call in
> "ambari-web/app/conrtollers/wizard/step3-controller.js"
>
> it is creating the request and calls rest api as i said :
> http://node1:8080/api/v1/requests
> <http://node1.b3lab.org:8080/api/v1/requests>
>
> but i couldn't find the mapping of this rest api. i mean what service
> method was fired with this rest api, i couldn't find.
>
> after i found this, i will insert new record into db with information to
> disable selinux, like script type, script name to be run etc.
>
> i.e.
> "{
>    "taskId":3,
>    "commandId":"2-0",
>    "hostname":"node1 <http://node1.b3lab.org>",
>    "role":"new_host_action",
>    "hostLevelParams":{
>
>    },
>    "roleParams":{
>       "check_execute_list":"disable_selinux",
>       "jdk_location":"http://node1:8080/resources/",
>       "threshold":"20"
>    },
>    "roleCommand":"ACTIONEXECUTE",
>    "clusterHostInfo":{
>
>    },
>    "configurations":{
>
>    },
>    "configuration_attributes":{
>
>    },
>    "forceRefreshConfigTags":[
>
>    ],
>    "commandParams":{
>       "command_timeout":"60",
>       "script":"disable_selinux.py",
>       "script_type":"PYTHON"
>    },
>    "kerberosCommandParams":[
>
>    ],
>    "commandType":"EXECUTION_COMMAND"
> },"
>
> so when *ambari-agent heardbeat*, it will get that record and will run
> script to disable selinux. am i wrong?
>
> i wonder if you could you help me to do that.
>
> i appreciate that.
>
> Mehmet Zahid Yüzügüldü
>



-- 
İyi Günler,

Mehmet Zahid Yüzügüldü

Re: about apache ambari workflow

Posted by John Speidel <js...@hortonworks.com>.
Mehmet,

The service methods for the "requests" endpoint are contained in org.apache.ambari.server.api.services.RequestService.
There are methods for GET/POST(create)/PUT(update).
You can start ambari server in debug mode like using the command "ambari-server start --debug" and then use a debugger to walk through the server code.

-John
________________________________________
From: Mehmet Zahid Yüzügüldü <zy...@gmail.com>
Sent: Monday, August 24, 2015 8:59 AM
To: dev@ambari.apache.org
Subject: about apache ambari workflow

Hi guys

i make lots of  research about ambari.

i am using hadoop cluster about 2 years. HBase, Yarn Ozie, Hue and Solr.

i am trying to add some dummy skills into ambari to learn the main
architecture.

my object is to add ambari functionality that disable selinux from nodes
with the help of ambari-server and ambari-agent usage.

java spring was used to develope ambari server, i tracked some api calls
from ambari-web.

i got the url "http://node1:8080/api/v1/requests
<http://node1.b3lab.org:8080/api/v1/requests>"  with request body:

{
  "RequestInfo": {
    "action": "check_host",
    "context": "Check host",
    "parameters": {
      "check_execute_list": "host_resolution_check",
      "jdk_location": "http://node1:8080/resources/",
      "threshold": "20",
      "hosts": "node1 <http://node1.b3lab.org>"
    }
  },
  "Requests/resource_filters": [
    {
      "hosts": "node1 <http://node1.b3lab.org>"
    }
  ]
}


i found js file related with this call in
"ambari-web/app/conrtollers/wizard/step3-controller.js"

it is creating the request and calls rest api as i said :
http://node1:8080/api/v1/requests
<http://node1.b3lab.org:8080/api/v1/requests>

but i couldn't find the mapping of this rest api. i mean what service
method was fired with this rest api, i couldn't find.

after i found this, i will insert new record into db with information to
disable selinux, like script type, script name to be run etc.

i.e.
"{
   "taskId":3,
   "commandId":"2-0",
   "hostname":"node1 <http://node1.b3lab.org>",
   "role":"new_host_action",
   "hostLevelParams":{

   },
   "roleParams":{
      "check_execute_list":"disable_selinux",
      "jdk_location":"http://node1:8080/resources/",
      "threshold":"20"
   },
   "roleCommand":"ACTIONEXECUTE",
   "clusterHostInfo":{

   },
   "configurations":{

   },
   "configuration_attributes":{

   },
   "forceRefreshConfigTags":[

   ],
   "commandParams":{
      "command_timeout":"60",
      "script":"disable_selinux.py",
      "script_type":"PYTHON"
   },
   "kerberosCommandParams":[

   ],
   "commandType":"EXECUTION_COMMAND"
},"

so when *ambari-agent heardbeat*, it will get that record and will run
script to disable selinux. am i wrong?

i wonder if you could you help me to do that.

i appreciate that.

Mehmet Zahid Yüzügüldü