Run the YARN service on a non-Kerberized cluster
You can create a YARN service definition JSON using the services API and run it on your cluster.
-
Create a YARN service definition JSON using the REST API.
The following example shows a YARN service definition added to a JSON file namedNoteEnsure that the service definition is unique in the cluster.
yarnservice.json
:{ "name": "redis-service", "version": "1.0.0", "description": "redis example", "components" : [ { "name": "redis", "number_of_containers": 1, "artifact": { "id": "library/redis", "type": "DOCKER" }, "launch_command": "", "resource": { "cpus": 1, "memory": "256" }, "configuration": { "env": { "YARN_CONTAINER_RUNTIME_DOCKER_RUN_OVERRIDE_DISABLE": "true" } } } ] }
-
Submit the service definition as specified.
NoteYou can submit the service definition only if you have write permissions to the HDFS home directory.YARN responds with the Application ID.The following example shows the curl command to submit the service definition:
curl --negotiate -u : -X POST -H "Content-Type: application/json" http://<resource manager>:8088/app/v1/services -d @yarnservice.json
- Optional:
Track the status of the service through the YARN UI or by using the REST
APIs.
The following example shows the curl command to read the status of the service:
curl --negotiate -u : http://<resource manager>:8088/app/v1/services/redis-service | python -m json.tool