-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1198][Spark Standalone] Documents for running zeppelin on production environments. #1227
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 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| --- | ||
| layout: page | ||
| title: "Apache Zeppelin on Spark cluster mode" | ||
| description: "" | ||
| group: install | ||
| --- | ||
| <!-- | ||
| Licensed 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. | ||
| --> | ||
| {% include JB/setup %} | ||
|
|
||
| # Apache Zeppelin on Spark Cluster Mode | ||
|
|
||
| <div id="toc"></div> | ||
|
|
||
| ## Overview | ||
| [Apache Spark](http://spark.apache.org/) has supported three cluster manager types([Standalone](http://spark.apache.org/docs/latest/spark-standalone.html), [Apache Mesos](http://spark.apache.org/docs/latest/running-on-mesos.html) and [Hadoop YARN](http://spark.apache.org/docs/latest/running-on-yarn.html)) so far. | ||
| 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](https://www.docker.com/) scripts. | ||
| So [install docker](https://docs.docker.com/engine/installation/) on the machine first. | ||
|
|
||
| ## Spark standalone mode | ||
| [Spark standalone](http://spark.apache.org/docs/latest/spark-standalone.html) is a simple cluster manager included with Spark that makes it easy to set up a cluster. | ||
| You can simply set up Spark standalone environment with below steps. | ||
|
|
||
| > **Note :** Since Apache Zeppelin and Spark use same `8080` port for their web UI, you might need to change `zeppelin.server.port` in `conf/zeppelin-site.xml`. | ||
|
|
||
| ### 1. Build Docker file | ||
| You can find docker script files under `scripts/docker/spark-cluster-managers`. | ||
|
|
||
| ``` | ||
| cd $ZEPPELIN_HOME/scripts/docker/spark-cluster-managers/spark_standalone | ||
| docker build -t "spark_standalone" . | ||
| ``` | ||
|
|
||
| ### 2. Run docker | ||
|
|
||
| ``` | ||
| docker run -it \ | ||
| -p 8080:8080 \ | ||
| -p 7077:7077 \ | ||
| -p 8888:8888 \ | ||
| -p 8081:8081 \ | ||
| -h sparkmaster \ | ||
| --name spark_standalone \ | ||
| spark_standalone bash; | ||
| ``` | ||
|
|
||
| ### 3. Configure Spark interpreter in Zeppelin | ||
| Set Spark master as `spark://localhost:7077` in Zeppelin **Interpreters** setting page. | ||
|
|
||
| <img src="../assets/themes/zeppelin/img/docs-img/standalone_conf.png" /> | ||
|
|
||
| ### 4. Run Zeppelin with Spark interpreter | ||
| After running single paragraph with Spark interpreter in Zeppelin, browse `https://localhost:8080` and check whether Spark cluster is running well or not. | ||
|
|
||
| <img src="../assets/themes/zeppelin/img/docs-img/spark_ui.png" /> | ||
|
|
||
| You can also simply verify that Spark is running well in Docker with below command. | ||
|
|
||
| ``` | ||
| ps -ef | grep spark | ||
| ``` | ||
|
|
||
|
|
54 changes: 54 additions & 0 deletions
54
scripts/docker/spark-cluster-managers/spark_standalone/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,54 @@ | ||
| # 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 | ||
| MAINTAINER hsshim@nflabs.com | ||
|
|
||
| ENV SPARK_PROFILE 1.6 | ||
| ENV SPARK_VERSION 1.6.2 | ||
| ENV HADOOP_PROFILE 2.3 | ||
| ENV SPARK_HOME /usr/local/spark | ||
|
|
||
| # Update the image with the latest packages | ||
| RUN yum update -y; yum clean all | ||
|
|
||
| # Get utils | ||
| RUN yum install -y \ | ||
| wget \ | ||
| tar \ | ||
| curl \ | ||
| && \ | ||
| 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://apache.mirror.cdnetworks.com/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 | ||
|
|
||
| #spark | ||
| EXPOSE 8080 7077 8888 8081 | ||
|
|
||
| ENTRYPOINT ["/etc/entrypoint.sh"] |
31 changes: 31 additions & 0 deletions
31
scripts/docker/spark-cluster-managers/spark_standalone/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,31 @@ | ||
| #!/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_MASTER_PORT=7077 | ||
|
|
||
| # run spark | ||
| cd /usr/local/spark/sbin | ||
| ./start-master.sh | ||
| ./start-slave.sh spark://`hostname`:$SPARK_MASTER_PORT | ||
|
|
||
| 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.
If it requires Docker, shall we say it in the title,s something like
Apache Zeppelin on Spark Cluster Mode (Standalone via Docker)?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.
It seems your title is better. I'll change the title.