-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1280][Spark on Yarn] Documents for running zeppelin on production environments using docker. #1318
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
9 commits
Select commit
Hold shift + click to select a range
633c930
running zeppelin on yarn
9e9390c
Minor update for spark_cluster_mode.md
AhyoungRyu cde5f8d
Modify document description so that this docs can be searched
AhyoungRyu 86ca513
Merge pull request #9 from AhyoungRyu/ZEPPELIN-1280-ahyoung
8c62cf1
fixed felixcheung pointed out.
4c8d72d
merge with Ayoung's
dad297c
update version
6c44b7b
Merge branch 'master' into ZEPPELIN-1280
60958cd
small changes for doc
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
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 |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| FROM centos:centos6 | ||
| MAINTAINER [email protected] | ||
|
|
||
| ENV SPARK_PROFILE 1.6 | ||
| ENV SPARK_VERSION 1.6.2 | ||
|
|
||
107 changes: 107 additions & 0 deletions
107
scripts/docker/spark-cluster-managers/spark_yarn_cluster/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,107 @@ | ||
| # 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.7 | ||
| ENV HADOOP_VERSION 2.7.0 | ||
|
|
||
| # 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 hadoop | ||
| RUN yum install -y curl which tar sudo openssh-server openssh-clients rsync | ||
|
|
||
| # hadoop | ||
| RUN curl -s https://archive.apache.org/dist/hadoop/core/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz | tar -xz -C /usr/local/ | ||
| RUN cd /usr/local && ln -s ./hadoop-$HADOOP_VERSION hadoop | ||
|
|
||
| ENV HADOOP_PREFIX /usr/local/hadoop | ||
| ENV HADOOP_COMMON_HOME /usr/local/hadoop | ||
| ENV HADOOP_HDFS_HOME /usr/local/hadoop | ||
| ENV HADOOP_MAPRED_HOME /usr/local/hadoop | ||
| ENV HADOOP_YARN_HOME /usr/local/hadoop | ||
| ENV HADOOP_CONF_DIR /usr/local/hadoop/etc/hadoop | ||
|
|
||
| RUN sed -i '/^export JAVA_HOME/ s:.*:export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64\nexport HADOOP_PREFIX=/usr/local/hadoop\nexport HADOOP_HOME=/usr/local/hadoop\n:' $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh | ||
| RUN sed -i '/^export HADOOP_CONF_DIR/ s:.*:export HADOOP_CONF_DIR=/usr/local/hadoop/etc/hadoop/:' $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh | ||
|
|
||
| RUN mkdir $HADOOP_PREFIX/input | ||
| RUN cp $HADOOP_PREFIX/etc/hadoop/*.xml $HADOOP_PREFIX/input | ||
|
|
||
| # hadoop configurations | ||
| ADD hdfs_conf/core-site.xml $HADOOP_PREFIX/etc/hadoop/core-site.xml | ||
| ADD hdfs_conf/hdfs-site.xml $HADOOP_PREFIX/etc/hadoop/hdfs-site.xml | ||
| ADD hdfs_conf/mapred-site.xml $HADOOP_PREFIX/etc/hadoop/mapred-site.xml | ||
| ADD hdfs_conf/yarn-site.xml $HADOOP_PREFIX/etc/hadoop/yarn-site.xml | ||
|
|
||
| RUN mkdir /data/ | ||
| RUN chmod 777 /data/ | ||
| RUN $HADOOP_PREFIX/bin/hdfs namenode -format | ||
|
|
||
| RUN rm /usr/local/hadoop/lib/native/* | ||
| RUN curl -Ls http://dl.bintray.com/sequenceiq/sequenceiq-bin/hadoop-native-64-$HADOOP_VERSION.tar|tar -x -C /usr/local/hadoop/lib/native/ | ||
|
|
||
| # install spark | ||
| RUN curl -s http://archive.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 | ||
| ENV SPARK_HOME /usr/local/spark | ||
|
|
||
| ENV YARN_CONF_DIR $HADOOP_PREFIX/etc/hadoop | ||
| ENV PATH $PATH:$SPARK_HOME/bin:$HADOOP_PREFIX/bin | ||
|
|
||
| # passwordless ssh | ||
| RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key | ||
| RUN ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key | ||
| RUN ssh-keygen -q -N "" -t rsa -f /root/.ssh/id_rsa | ||
| RUN cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys | ||
|
|
||
| ADD ssh_config /root/.ssh/config | ||
| RUN chmod 600 /root/.ssh/config | ||
| RUN chown root:root /root/.ssh/config | ||
| RUN chmod +x /usr/local/hadoop/etc/hadoop/*-env.sh | ||
|
|
||
| # update boot script | ||
| COPY entrypoint.sh /etc/entrypoint.sh | ||
| RUN chown root.root /etc/entrypoint.sh | ||
| RUN chmod 700 /etc/entrypoint.sh | ||
|
|
||
| # Hdfs ports | ||
| EXPOSE 50010 50020 50070 50075 50090 | ||
| # Mapred ports | ||
| EXPOSE 9000 9001 | ||
| #Yarn ports | ||
| EXPOSE 8030 8031 8032 8033 8040 8042 8088 | ||
| #spark | ||
| EXPOSE 8080 7077 8888 8081 | ||
|
|
||
| ENTRYPOINT ["/etc/entrypoint.sh"] |
60 changes: 60 additions & 0 deletions
60
scripts/docker/spark-cluster-managers/spark_yarn_cluster/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,60 @@ | ||
| #!/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. | ||
|
|
||
| echo 'hadoop' |passwd root --stdin | ||
|
|
||
| : ${HADOOP_PREFIX:=/usr/local/hadoop} | ||
|
|
||
| $HADOOP_PREFIX/etc/hadoop/hadoop-env.sh | ||
|
|
||
| rm /tmp/*.pid | ||
|
|
||
| # installing libraries if any - (resource urls added comma separated to the ACP system variable) | ||
| cd $HADOOP_PREFIX/share/hadoop/common ; for cp in ${ACP//,/ }; do echo == $cp; curl -LO $cp ; done; cd - | ||
|
|
||
| cp $SPARK_HOME/conf/metrics.properties.template $SPARK_HOME/conf/metrics.properties | ||
|
|
||
| # start hadoop | ||
| service sshd start | ||
| $HADOOP_PREFIX/sbin/start-dfs.sh | ||
| $HADOOP_PREFIX/sbin/start-yarn.sh | ||
|
|
||
| $HADOOP_PREFIX/bin/hdfs dfsadmin -safemode leave && $HADOOP_PREFIX/bin/hdfs dfs -put $SPARK_HOME-$SPARK_VERSION-bin-hadoop$HADOOP_PROFILE/lib /spark | ||
|
|
||
| # start spark | ||
| export SPARK_MASTER_OPTS="-Dspark.driver.port=7001 -Dspark.fileserver.port=7002 | ||
| -Dspark.broadcast.port=7003 -Dspark.replClassServer.port=7004 | ||
| -Dspark.blockManager.port=7005 -Dspark.executor.port=7006 | ||
| -Dspark.ui.port=4040 -Dspark.broadcast.factory=org.apache.spark.broadcast.HttpBroadcastFactory" | ||
| export SPARK_WORKER_OPTS="-Dspark.driver.port=7001 -Dspark.fileserver.port=7002 | ||
| -Dspark.broadcast.port=7003 -Dspark.replClassServer.port=7004 | ||
| -Dspark.blockManager.port=7005 -Dspark.executor.port=7006 | ||
| -Dspark.ui.port=4040 -Dspark.broadcast.factory=org.apache.spark.broadcast.HttpBroadcastFactory" | ||
|
|
||
| export SPARK_MASTER_PORT=7077 | ||
|
|
||
| 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 |
22 changes: 22 additions & 0 deletions
22
scripts/docker/spark-cluster-managers/spark_yarn_cluster/hdfs_conf/core-site.xml
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,22 @@ | ||
| <!-- | ||
| 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. | ||
| --> | ||
| <configuration> | ||
| <property> | ||
| <name>fs.defaultFS</name> | ||
| <value>hdfs://0.0.0.0:9000</value> | ||
| </property> | ||
| </configuration> |
78 changes: 78 additions & 0 deletions
78
scripts/docker/spark-cluster-managers/spark_yarn_cluster/hdfs_conf/hdfs-site.xml
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,78 @@ | ||
| <!-- | ||
| 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. | ||
| --> | ||
| <configuration> | ||
| <property> | ||
| <name>dfs.replication</name> | ||
| <value>1</value> | ||
| </property> | ||
|
|
||
| <property> | ||
| <name>dfs.data.dir</name> | ||
| <value>/data/hdfs</value> | ||
| <final>true</final> | ||
| </property> | ||
|
|
||
| <property> | ||
| <name>dfs.permissions</name> | ||
| <value>false</value> | ||
| </property> | ||
|
|
||
| <property> | ||
| <name>dfs.client.use.datanode.hostname</name> | ||
| <value>true</value> | ||
| <description>Whether clients should use datanode hostnames when | ||
| connecting to datanodes. | ||
| </description> | ||
| </property> | ||
|
|
||
| <property> | ||
| <name>dfs.datanode.use.datanode.hostname</name> | ||
| <value>true</value> | ||
| <description>Whether datanodes should use datanode hostnames when | ||
| connecting to other datanodes for data transfer. | ||
| </description> | ||
| </property> | ||
|
|
||
| <property> | ||
| <name>dfs.datanode.address</name> | ||
| <value>0.0.0.0:50010</value> | ||
| <description> | ||
| The address where the datanode server will listen to. | ||
| If the port is 0 then the server will start on a free port. | ||
| </description> | ||
| </property> | ||
|
|
||
| <property> | ||
| <name>dfs.datanode.http.address</name> | ||
| <value>0.0.0.0:50075</value> | ||
| <description> | ||
| The datanode http server address and port. | ||
| If the port is 0 then the server will start on a free port. | ||
| </description> | ||
| </property> | ||
|
|
||
| <property> | ||
| <name>dfs.datanode.ipc.address</name> | ||
| <value>0.0.0.0:50020</value> | ||
| <description> | ||
| The datanode ipc server address and port. | ||
| If the port is 0 then the server will start on a free port. | ||
| </description> | ||
| </property> | ||
|
|
||
| </configuration> | ||
|
|
Oops, something went wrong.
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.
you mean
ps -ef | grep spark?Uh oh!
There was an error while loading. Please reload this page.
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.
hadoop is also running so just
ps -efis the best way?Uh oh!
There was an error while loading. Please reload this page.
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.
Ah right. But i just wanted to filter processes list.