Support Questions

Find answers, ask questions, and share your expertise

Installing Jupyter on sandbox

avatar
Contributor

I am trying to install jupyter on sandbox but i can not seem to figure out a way to achieve this. I followed the tutorial available on hortonworks, and although, everything installed quite fine. I can not run the Application when i run

"jupyter-notebook --allow-root"

screen-shot-2017-06-07-at-30905-pm.png

When i copy the url to the browser, it just returns an ERR.

This is the tutorial that i followed

https://hortonworks.com/hadoop-tutorial/using-ipython-notebook-with-apache-spark/

Any help here please?

5 REPLIES 5

avatar

@Abifoluwa Oni What is the error your browser returns ?

avatar
Contributor

hey @Sandeep Nemuri it just keeps running and nothing happens, or sometimes it says ERR_EMPTY_RESPONSE. I decided to install w3m browser for terminal browsing in CENTOS Guest system, and ran the link in the command line, and it worked. So the problem arises when i try to access the link in the Host system, i am using a MacBook Pro too, so i don't know if it has something to do with it.

I also followed this Tutorial to see if forwarding the port will work, but, it changed nothing.

"https://docs.fedoraproject.org/en-US/Fedora/19/html/Security_Guide/sec-Configure_Port_Forwarding-CLI..."

I will attach screen-shots of jupyter working in the guest system

16169-screen-shot-2017-06-08-at-51436-pm.png

16170-screen-shot-2017-06-08-at-51447-pm.png

avatar
New Contributor

Hi,

I am also facing the same error .,all installations are done properly ,but cannot see the URL from on the screen .

[root@sandbox ~]# jupyter notebook --allow-root [I 17:45:08.017 NotebookApp] The port 8888 is already in use, trying another port. [I 17:45:08.022 NotebookApp] Serving notebooks from local directory: /root [I 17:45:08.023 NotebookApp] 0 active kernels [I 17:45:08.023 NotebookApp] The Jupyter Notebook is running at: http://localhost:8889/?token=aeec5939b73ea3ec7a3c5f0ca5d9c19545d24991e85c32d2 [I 17:45:08.023 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [W 17:45:08.023 NotebookApp] No web browser found: could not locate runnable browser. [C 17:45:08.023 NotebookApp] Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8889/?token=aeec5939b73ea3ec7a3c5f0ca5d9c19545d24991e85c32d2 ^C[I 17:50:06.260 NotebookApp] interrupted Serving notebooks from local directory: /root 0 active kernels The Jupyter Notebook is running at: http://localhost:8889/?token=aeec5939b73ea3ec7a3c5f0ca5d9c19545d24991e85c32d2

Regards,

Saby

avatar
Contributor

Honestly haven't found a way around it, i keep coming back to see if there will be an information on solving this, and i can't find any. I am honestly thinking it has something to do with port forwarding issues, or maybe the installation instructions on the page is wrong.

Let me know if you do find a way around it, if i do, i will be sure to post it here.

avatar
Contributor

It has been a while and I believed you already got it working. But for those people want to know how to do it, I am going to show you how I did it.

Before I get started, I wanted to let you know I found the informative link by googling "setup Jupyter notebook at Hortonworks sandbox". Based on the link and I made some minor changes, I got it working.

####========================================================
### login as root
####========================================================
sandbox-version

== Sandbox Information ==
Platform: hdp-security
Build date: 06-18-2018
Ambari version: 2.6.2.0-155
Hadoop version: Hadoop 2.7.3.2.6.5.0-292
OS: CentOS Linux release 7.5.1804 (Core)
====

####========================================================
### Install Jupyter Dependencies
####========================================================
pip install --ignore-installed pyparsing
yum install epel-release
sudo wget https://bootstrap.pypa.io/ez_setup.py -O - | python ;sudo yum install python-pip python-wheel python-devel gcc
pip install --upgrade pip
pip install --upgrade pip wheel pandas numpy scipy scikit-learn matplotlib virtualenv
####========================================================
### Install Jupyter
####========================================================
pip install jupyter

####========================================================
### Setup folders and files
####========================================================
jupyter notebook --generate-config
sudo mkdir -p /ibm/conf
sudo chown -R spark:hadoop /ibm
cp ~/.jupyter/jupyter_notebook_config.py /ibm/conf/

####========================================================
### Setup startup shell script
####========================================================
vi /ibm/scripts/start_jupyter.sh

#copy the paste the following contents

#! bin/bash
set -x
USER=$1
JUPYTER_HOST=sandbox-hdp.hortonworks.com
JUPYTER_PORT=8889
su - ${USER} << EOF 
export SPARK_HOME=/usr/hdp/current/spark-client
export PYSPARK_SUBMIT_ARGS="--master yarn-client pyspark-shell"
export HADOOP_HOME=/usr/hdp/current/hadoop-client
export HADOOP_CONF_DIR=/usr/hdp/current/hadoop-client/conf
export PYTHONPATH="/usr/hdp/current/spark-client/python:/usr/hdp/current/spark-client/python/lib/py4j-0.9-src.zip"
export PYTHONSTARTUP=/usr/hdp/current/spark-client/python/pyspark/shell.py
export PYSPARK_SUBMIT_ARGS="--master yarn-client pyspark-shell"
echo "Starting Jupyter daemon on HDP Cluster ..."
jupyter notebook --config=/ibm/conf/jupyter_notebook_config.py --ip=${JUPYTER_HOST} --port=${JUPYTER_PORT}&
EOF
exit 0

####========================================================
### Run startup shell script
####========================================================

chown -R spark:hadoop /ibm
chmod 777 /ibm/script/start_jupyter.sh
cd /ibm/scripts
./start_jupyter.sh spark
####========================================================
### Copy the link from above step's output and paste to your computer's browser 
####========================================================
# make sure you define sandbox.hortonworks.com in your hosts file
http://sandbox.hortonworks.com:8889/?token=c982c0f95222abcf2900e3aeb9d9c59cc0386cc04c6c154d 

Test in Jupyter.

91636-2018-10-06-20-55-23.jpg