mesos / kafka

Apache Kafka on Apache Mesos
Apache License 2.0
414 stars 140 forks source link

Kafka-mesos jar not found in current dir #172

Closed frankscholten closed 8 years ago

frankscholten commented 8 years ago

The problem

I tried running Kafka on minimesos and noticed that the scheduler requires the kafka-mesos jar to be available in the sandbox. See the stderr logs.

WARNING: terminal is not fully functional
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0110 01:10:16.338825 14080 process.cpp:995] libprocess is initialized on 172.17.0.6:54103 for 8 cpus
I0110 01:10:16.339066 14080 logging.cpp:172] INFO level logging started!
I0110 01:10:16.339236 14080 logging.cpp:177] Logging to /var/log
I0110 01:10:16.339642 14080 exec.cpp:134] Version: 0.25.0
I0110 01:10:16.340152 14085 exec.cpp:184] Executor started at: executor(1)@172.17.0.6:54103 with pid 14080
I0110 01:10:16.341146 14088 exec.cpp:208] Executor registered on slave ef6bdeb8-cd19-4ad2-baa9-6b0593787e49-S0
I0110 01:10:16.341588 14088 exec.cpp:220] Executor::registered took 49563ns
I0110 01:10:16.341641 14088 exec.cpp:295] Executor asked to run task 'kafka-mesos-scheduler.e891e33c-b736-11e5-a399-0242ac110005'
I0110 01:10:16.341676 14088 exec.cpp:304] Executor::launchTask took 21761ns
I0110 01:10:16.342524 14081 exec.cpp:517] Executor sending status update TASK_RUNNING (UUID: b2fd49e9-9d96-4a6b-acc1-2dc59f6694a0) for task kafka-mesos-scheduler.e891e33c-b736-11e5-a399-
0242ac110005 of framework ef6bdeb8-cd19-4ad2-baa9-6b0593787e49-0000
I0110 01:10:16.404819 14082 exec.cpp:341] Executor received status update acknowledgement b2fd49e9-9d96-4a6b-acc1-2dc59f6694a0 for task kafka-mesos-scheduler.e891e33c-b736-11e5-a399-0242
ac110005 of framework ef6bdeb8-cd19-4ad2-baa9-6b0593787e49-0000
tput: No value for $TERM and no -T specified
Exception in thread "main" java.lang.IllegalStateException: kafka-mesos.*\.jar not found in current dir
        at ly.stealth.mesos.kafka.HttpServer$.resolveDeps(HttpServer.scala:92)
        at ly.stealth.mesos.kafka.HttpServer$.start(HttpServer.scala:44)
        at ly.stealth.mesos.kafka.Scheduler$.start(Scheduler.scala:342)
        at ly.stealth.mesos.kafka.Cli$SchedulerCli$.handle(Cli.scala:369)
        at ly.stealth.mesos.kafka.Cli$.exec(Cli.scala:54)
        at ly.stealth.mesos.kafka.Cli$.main(Cli.scala:36)
        at ly.stealth.mesos.kafka.Cli.main(Cli.scala)
I0110 01:10:16.744897 14086 exec.cpp:517] Executor sending status update TASK_FAILED (UUID: 1fe9a831-6fab-49dd-9139-ba74ac711805) for task kafka-mesos-scheduler.e891e33c-b736-11e5-a399-0
242ac110005 of framework ef6bdeb8-cd19-4ad2-baa9-6b0593787e49-0000
I0110 01:10:16.797904 14083 exec.cpp:341] Executor received status update acknowledgement 1fe9a831-6fab-49dd-9139-ba74ac711805 for task kafka-mesos-scheduler.e891e33c-b736-11e5-a399-0242
ac110005 of framework ef6bdeb8-cd19-4ad2-baa9-6b0593787e49-0000

Steps to reproduce

{
    "id":"kafka-mesos-scheduler",
    "cpus": 0.5,
    "mem": 256,
    "ports": [7000],
    "cmd": "java -jar /home/path/to/mesos-kafka/kafka-mesos-0.9.4.0.jar scheduler --master=zk://minimesos-zookeeper:2181 --zk=minimesos-zookeeper:2181 --api=http://localhost:7000 --storage=zk:/kafka-mesos",
    "instances": 1
}

How about packaging the executor jar inside the scheduler jar and serve it as a resource. We used this resource technique in Mesos Elasticsearch. See the SimpleFileServer and the Main which initializes the server with the Elasticsearch executor jar.

frankscholten commented 8 years ago

@joestein Currently adding Jar support to http://github.com/mesos/logstash as well. Are you interested in a PR to solve this issue?

joestein commented 8 years ago

Hey Frank, that sounds like an interesting addition. It is important to not break the functionality of the executor being independent from the scheduler it is how we can run different kafka broker binary versions through the scheduler. It is quite vital to working with kafka so you can run a different branch, patch or distro without being pinned to any one Kafka version/binary. If you can make a PR that solves the issue without changing and breaking the multiple version/binary compatibility that would be great. Maybe something like "if not specified/found" then use the scheduler supplied executor or something maybe that would work @dmitrypekar might have another recommend or maybe you can come up with an approach.

dmitrypekar commented 8 years ago

I would recommend to add --jar and --kafka options having default values: kafka-mesos*.jar, kafka*.tgz. This way it would be possible to override the place from which jar and distro is loaded for those corner cases.

That approach seems to be straightforward and consistent with mechanism for specifying jre path that exists now.

frankscholten commented 8 years ago

Instead of adding Jar support I added a minimesos quickstart script in https://github.com/mesos/kafka/pull/183

Steps to run Mesos Kafka

  1. Install minimesos by running curl -sSL https://minimesos.org/install | sh
  2. Determine the wlan0 or eth0 IP address of your machine
  3. Run the quickstart script with the IP ./quickstart.sh 192.168.X.X

and off you go.

jiteshsharma commented 8 years ago

I am getting this error on running the quickstart.sh script Unable to find image 'vagrant/kafka-mesos:latest' locally Pulling repository docker.io/vagrant/kafka-mesos docker: Error: image vagrant/kafka-mesos not found.

frankscholten commented 8 years ago

@jiteshsharma First build the Mesos Kafka Docker image in src/docker/Dockerfile