Skip to content

Instantly share code, notes, and snippets.

@erikdw
Last active September 14, 2017 22:56
Show Gist options
  • Save erikdw/055dc472bdfcfbe707a678f209d5afd7 to your computer and use it in GitHub Desktop.
Save erikdw/055dc472bdfcfbe707a678f209d5afd7 to your computer and use it in GitHub Desktop.
Issue with task not launching
# git clone github.com:mesos/mesos
# cd mesos
# mkdir build
# ... blah blah ...
# build it
# cd build
(mesos/build) [master] % bin/mesos-local.sh
# Find slaveId from mesos UI, update in following command
% curl -i -d slaveId=589abbd9-f1f6-41f3-a1b8-9a7ae8bbebdf-S0 -d resources='[
        {
          "name": "cpus",
          "type": "SCALAR",
          "scalar": { "value": 1 },
          "role": "ads",
          "reservation": {
            "principal": "a"
          }
        },
        {
          "name": "mem",
          "type": "SCALAR",
          "scalar": { "value": 4096 },
          "role": "ads",
          "reservation": {
            "principal": "a"
          }
        }
      ]' -X POST http://localhost:5050/master/reserve
% cat quota.json 
{
  "role": "ads",
  "guarantee": [
    {
      "name": "cpus",
      "type": "SCALAR",
      "scalar": { "value": 1 }
    },
    {
      "name": "mem",
      "type": "SCALAR",
      "scalar": { "value": 6144 }
    }
  ]
}
% curl -d @quota.json -X POST http://localhost:5050/quota
(mesos/build) [master] % bin/mesos.sh execute --master="localhost:5050" --command="sleep 50000" --name="sleep|50000|ads-3" --role=ads --resources="cpus:0.4;mem:128"
WARNING: Logging before InitGoogleLogging() is written to STDERR
W0913 16:26:48.336500 2032250880 scheduler.cpp:169] 
**************************************************
Scheduler driver bound to loopback interface! Cannot communicate with remote master(s). You might want to set 'LIBPROCESS_IP' environment variable to use a routable IP address.
**************************************************
I0913 16:26:48.336680 2032250880 scheduler.cpp:184] Version: 1.5.0
I0913 16:26:48.343331 3211264 scheduler.cpp:470] New master detected at [email protected]:5050
Subscribed with ID 10ab8583-b0b0-429a-81ef-4484513b5830-0003
Submitted task 'sleep|50000|ads-3' to agent '589abbd9-f1f6-41f3-a1b8-9a7ae8bbebdf-S0'
Received status update TASK_RUNNING for task 'sleep|50000|ads-3'
  source: SOURCE_EXECUTOR
# hanging since the cmd is "sleep 50000"...
# modify name for 2nd task
(mesos/build) [master] % bin/mesos.sh execute --master="localhost:5050" --command="sleep 50000" --name="sleep|50000|ads-4" --role=ads --resources="cpus:0.4;mem:128"
WARNING: Logging before InitGoogleLogging() is written to STDERR
W0913 16:27:11.202905 2674688 scheduler.cpp:169] 
**************************************************
Scheduler driver bound to loopback interface! Cannot communicate with remote master(s). You might want to set 'LIBPROCESS_IP' environment variable to use a routable IP address.
**************************************************
I0913 16:27:11.203125 2674688 scheduler.cpp:184] Version: 1.5.0
I0913 16:27:11.209578 1601536 scheduler.cpp:470] New master detected at [email protected]:5050
Subscribed with ID 10ab8583-b0b0-429a-81ef-4484513b5830-0004
Submitted task 'sleep|50000|ads-4' to agent '589abbd9-f1f6-41f3-a1b8-9a7ae8bbebdf-S0'
Received status update TASK_RUNNING for task 'sleep|50000|ads-4'
  source: SOURCE_EXECUTOR
# hanging since the cmd is "sleep 50000"...
```
(mesos/build) [master] % bin/mesos.sh execute --master="localhost:5050" --command="sleep 50000" --name="sleep|50000|mini" --resources="cpus:0.1;mem:128"
WARNING: Logging before InitGoogleLogging() is written to STDERR
W0914 15:38:39.939389 1064960 scheduler.cpp:169]
**************************************************
Scheduler driver bound to loopback interface! Cannot communicate with remote master(s). You might want to set 'LIBPROCESS_IP' environment variable to use a routable IP address.
**************************************************
I0914 15:38:39.939586 1064960 scheduler.cpp:184] Version: 1.5.0
I0914 15:38:39.949630 3211264 scheduler.cpp:470] New master detected at [email protected]:5050
Subscribed with ID 10ab8583-b0b0-429a-81ef-4484513b5830-0010
# Hanging forever.
```
At this point here's the situation:
1. the framework is active in the list in this UI: http://localhost:5050/#/frameworks
2. the framework / task is isn't assigned on any agent (of course, because it didn't get the "Submitted task" log message from `mesos.sh execute`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment