Managing Data Operating System
Also available as:
PDF
loading table of contents...

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.

  1. Create a YARN service definition JSON using the REST API.
    Note
    Note
    Ensure that the service definition is unique in the cluster.
    The following example shows a YARN service definition added to a JSON file named 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"
              }
            }
          }
        ]
    }
  2. Submit the service definition as specified.
    Note
    Note
    You 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
  3. 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