-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1279] Spark on Mesos Docker. #1389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a3b0ded
create dockerfile for mesos
c808350
add image file and doc
d8c43b4
add navigation
159bafc
fix anchor
2b821b4
fix docs
1cbe9d3
fix spark version and mesos
076fdba
Change zeppelin_mesos_conf.png file
AhyoungRyu 974366a
Merge pull request #10 from AhyoungRyu/ZEPPELIN-1279-ahyoung
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| --- | ||
| layout: page | ||
| title: "Apache Zeppelin on Spark cluster mode" | ||
| description: "This document will guide you how you can build and configure the environment on 3 types of Spark cluster manager with Apache Zeppelin using docker scripts." | ||
| description: "This document will guide you how you can build and configure the environment on 3 types of Spark cluster manager(Standalone, Hadoop Yarn, Apache Mesos) with Apache Zeppelin using docker scripts." | ||
| group: install | ||
| --- | ||
| <!-- | ||
|
|
@@ -113,7 +113,7 @@ docker run -it \ | |
|
|
||
| ### 3. Verify running Spark on YARN. | ||
|
|
||
| You can simply verify the processes of Spark and YARN is running well in Docker with below command. | ||
| You can simply verify the processes of Spark and YARN are running well in Docker with below command. | ||
|
|
||
| ``` | ||
| ps -ef | ||
|
|
@@ -140,3 +140,65 @@ Don't forget to set Spark `master` as `yarn-client` in Zeppelin **Interpreters** | |
| After running a single paragraph with Spark interpreter in Zeppelin, browse `http://<hostname>:8088/cluster/apps` and check Zeppelin application is running well or not. | ||
|
|
||
| <img src="../assets/themes/zeppelin/img/docs-img/yarn_applications.png" /> | ||
|
|
||
|
|
||
|
|
||
| ## Spark on Mesos mode | ||
| You can simply set up [Spark on Mesos](http://spark.apache.org/docs/latest/running-on-mesos.html) docker environment with below steps. | ||
|
|
||
|
|
||
| ### 1. Build Docker file | ||
|
|
||
| ``` | ||
| cd $ZEPPELIN_HOME/scripts/docker/spark-cluster-managers/spark_mesos | ||
| docker build -t "spark_mesos" . | ||
| ``` | ||
|
|
||
|
|
||
| ### 2. Run docker | ||
|
|
||
| ``` | ||
| docker run --net=host -it \ | ||
| -p 8080:8080 \ | ||
| -p 7077:7077 \ | ||
| -p 8888:8888 \ | ||
| -p 8081:8081 \ | ||
| -p 8082:8082 \ | ||
| -p 5050:5050 \ | ||
| -p 5051:5051 \ | ||
| -p 4040:4040 \ | ||
| -h sparkmaster \ | ||
| --name spark_mesos \ | ||
| spark_mesos bash; | ||
| ``` | ||
|
|
||
| ### 3. Verify running Spark on Mesos. | ||
|
|
||
| You can simply verify the processes of Spark and Mesos are running well in Docker with below command. | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you missed "below command" :) |
||
| ``` | ||
| ps -ef | ||
| ``` | ||
|
|
||
| You can also check each application web UI for Mesos on `http://<hostname>:5050/cluster` and Spark on `http://<hostname>:8080/`. | ||
|
|
||
|
|
||
| ### 4. Configure Spark interpreter in Zeppelin | ||
|
|
||
| ``` | ||
| export MASTER=mesos://127.0.1.1:5050 | ||
| export MESOS_NATIVE_JAVA_LIBRARY=[PATH OF libmesos.so] | ||
| export SPARK_HOME=[PATH OF SPARK HOME] | ||
| ``` | ||
|
|
||
|
|
||
| Don't forget to set Spark `master` as `mesos://127.0.1.1:5050` in Zeppelin **Interpreters** setting page like below. | ||
|
|
||
| <img src="../assets/themes/zeppelin/img/docs-img/zeppelin_mesos_conf.png" /> | ||
|
|
||
|
|
||
| ### 5. Run Zeppelin with Spark interpreter | ||
| After running a single paragraph with Spark interpreter in Zeppelin, browse `http://<hostname>:5050/#/frameworks` and check Zeppelin application is running well or not. | ||
|
|
||
| <img src="../assets/themes/zeppelin/img/docs-img/mesos_frameworks.png" /> | ||
|
|
||
63 changes: 63 additions & 0 deletions
63
scripts/docker/spark-cluster-managers/spark_mesos/Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| FROM centos:centos6 | ||
|
|
||
| ENV SPARK_PROFILE 2.0 | ||
| ENV SPARK_VERSION 2.0.0 | ||
| ENV HADOOP_PROFILE 2.3 | ||
| ENV HADOOP_VERSION 2.3.0 | ||
|
|
||
| # Update the image with the latest packages | ||
| RUN yum update -y; yum clean all | ||
|
|
||
| # Get utils | ||
| RUN yum install -y \ | ||
| wget \ | ||
| tar \ | ||
| curl \ | ||
| svn \ | ||
| cyrus-sasl-md5 \ | ||
| libevent2-devel \ | ||
| && \ | ||
| yum clean all | ||
|
|
||
| # Remove old jdk | ||
| RUN yum remove java; yum remove jdk | ||
|
|
||
| # install jdk7 | ||
| RUN yum install -y java-1.7.0-openjdk-devel | ||
| ENV JAVA_HOME /usr/lib/jvm/java | ||
| ENV PATH $PATH:$JAVA_HOME/bin | ||
|
|
||
| # install spark | ||
| RUN curl -s http://www.apache.org/dist/spark/spark-$SPARK_VERSION/spark-$SPARK_VERSION-bin-hadoop$HADOOP_PROFILE.tgz | tar -xz -C /usr/local/ | ||
| RUN cd /usr/local && ln -s spark-$SPARK_VERSION-bin-hadoop$HADOOP_PROFILE spark | ||
|
|
||
| # update boot script | ||
| COPY entrypoint.sh /etc/entrypoint.sh | ||
| RUN chown root.root /etc/entrypoint.sh | ||
| RUN chmod 700 /etc/entrypoint.sh | ||
|
|
||
| # install mesos | ||
| RUN wget http://repos.mesosphere.com/el/6/x86_64/RPMS/mesos-1.0.0-2.0.89.centos65.x86_64.rpm | ||
| RUN rpm -Uvh mesos-1.0.0-2.0.89.centos65.x86_64.rpm | ||
|
|
||
| #spark | ||
| EXPOSE 8080 7077 7072 8081 8082 | ||
|
|
||
| #mesos | ||
| EXPOSE 5050 5051 | ||
|
|
||
| ENTRYPOINT ["/etc/entrypoint.sh"] |
48 changes: 48 additions & 0 deletions
48
scripts/docker/spark-cluster-managers/spark_mesos/entrypoint.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #!/bin/bash | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| export SPARK_HOME=/usr/local/spark/ | ||
| export SPARK_MASTER_PORT=7077 | ||
| export SPARK_MASTER_WEBUI_PORT=8080 | ||
| export SPARK_WORKER_PORT=8888 | ||
| export SPARK_WORKER_WEBUI_PORT=8081 | ||
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/jre/lib/amd64/server/ | ||
|
|
||
| # spark configuration | ||
| cp $SPARK_HOME/conf/spark-env.sh.template $SPARK_HOME/conf/spark-env.sh | ||
| echo "export MESOS_NATIVE_JAVA_LIBRARY=/usr/lib/libmesos.so" >> $SPARK_HOME/conf/spark-env.sh | ||
|
|
||
| cp $SPARK_HOME/conf/spark-defaults.conf.template $SPARK_HOME/conf/spark-defaults.conf | ||
| echo "spark.master mesos://`hostname`:5050" >> $SPARK_HOME/conf/spark-defaults.conf | ||
| echo "spark.mesos.executor.home /usr/local/spark" >> $SPARK_HOME/conf/spark-defaults.conf | ||
|
|
||
| # run spark | ||
| cd $SPARK_HOME/sbin | ||
| ./start-master.sh | ||
| ./start-slave.sh spark://`hostname`:$SPARK_MASTER_PORT | ||
|
|
||
| # start mesos | ||
| mesos-master --ip=0.0.0.0 --work_dir=/var/lib/mesos &> /var/log/mesos_master.log & | ||
| mesos-slave --master=0.0.0.0:5050 --work_dir=/var/lib/mesos --launcher=posix &> /var/log/mesos_slave.log & | ||
|
|
||
| CMD=${1:-"exit 0"} | ||
| if [[ "$CMD" == "-d" ]]; | ||
| then | ||
| service sshd stop | ||
| /usr/sbin/sshd -D -d | ||
| else | ||
| /bin/bash -c "$*" | ||
| fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no number 1 :)
Maybe