前提:机器安装有conda环境

官方文档:http://jupyterhub.readthedocs.io/en/stable/quickstart.html

1.安装conda3

jupyterhub需要python3环境,python3现在在conda官网之上是配置的conda3,默认现在kylin中环境为conda2,对应着python2,同时/usr/hdp/hdp-select需要py2环境

所以原有机器的anaconda2环境不能变动

官网下载安装anaconda3,官网下载安装>>官网地址

wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh

然后运行sh脚本即可

conda可以独立创建python3环境,但是会影响到其它组件的安装等,而且spark-sqlhive也均需要py2环境

2.安装jupyterhub

[root@10-112-41-157 .jupyterhub]# conda install -c conda-forge jupyterhub
[root@10-112-41-157 .jupyterhub]# conda install notebook

如果执行jupyterhub没有的话,查看/letv/usr/local/anaconda2/envs/jupyterhub_python3/bin目录,如果也没有jupyterhub,则重新执行conda install -c conda-forge jupyterhub命令,可能openssl没有安装成功

3.jupyterhub安装检查

[root@10-127-220-93 .conda]#jupyterhub -h

4.生成config文件

[root@10-127-220-93 .conda]# jupyterhub --generate-config

注意:jupyterhub_config.py文件会在当时执行路径下生成,注意生成之后具体位置的存放,可以直接在/root目录下新建一个隐藏目录,本文中mkdir /root/.jupyterhub

5.加入ladp的验证

安装pip install jupyterhub-ldapauthenticator插件,具体github参考https://github.com/jupyterhub/ldapauthenticator

[root@10-112-41-157 .jupyterhub]# conda install -c conda-forge jupyterhub-ldapauthenticator

在jupyterhub_config.py文件中查找c.JupyterHub.authenticator_class

加入以下配置文件

c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
c.LDAPAuthenticator.server_address = 'ldap.letv.cn'
c.LDAPAuthenticator.lookup_dn = False
c.LDAPAuthenticator.user_search_base = 'OU=letv,DC=letv,DC=local'
c.LDAPAuthenticator.user_attribute = 'sAMAccountName'
c.LDAPAuthenticator.escape_userdn = False
c.LDAPAuthenticator.bind_dn_template = '{username}@le.com'

6.其它配置文件的改动

[root@10-112-41-157 .jupyterhub]# grep ^[^#] jupyterhub_config.py
c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
c.LDAPAuthenticator.server_address = 'ldap.letv.cn'
c.LDAPAuthenticator.lookup_dn = False
c.LDAPAuthenticator.user_search_base = 'OU=letv,DC=letv,DC=local'
c.LDAPAuthenticator.user_attribute = 'sAMAccountName'
c.LDAPAuthenticator.escape_userdn = False
c.LDAPAuthenticator.bind_dn_template = '{username}@le.com'
c.JupyterHub.port = 80
c.Spawner.default_url = '/lab'
  • 1.jupyterhub的默认端口为8000,上述例子的参数c.JupyterHub.port改为80即可

  • 2.默认进入jupyterhub的页面为/tree?,将c.Spawner.default_url改为/lab即可

  • 3.jupyterhub默认为非交互模式,所以/etc/profile的环境变量对jupyterhub web中的环境不受影响,所以需要设定/etc/bashrc的值,同时/root/.bashrc中的值在初始安装anaconda3的时候,可能会有写入,注意对整个环境变量的影响,可注释

文中各环境变量为

[root@10-112-41-157 .jupyterhub]# cat /etc/profile
以上略
export ANACONDA2_HOME=/usr/local/anaconda2
export JAVA_HOME=/usr/local/java
export ANACONDA3_HOME=/letv/anaconda3
export PYSPARK_PYTHON=$ANACONDA2_HOME/bin/python
export PYSPARK_DRIVER_PYTHON=$ANACONDA2_HOME/bin/python
export SPARK_HOME=/usr/hdp/current/spark2-client
export PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.4-src.zip
export PATH=$JAVA_HOME/bin:$ANACONDA2_HOME/bin:$PATH
[root@10-112-41-157 .jupyterhub]# cat /etc/bashrc
以上略
export ANACONDA2_HOME=/usr/local/anaconda2
export JAVA_HOME=/usr/local/java
export ANACONDA3_HOME=/letv/anaconda3
export PYSPARK_PYTHON=$ANACONDA2_HOME/bin/python
export PYSPARK_DRIVER_PYTHON=$ANACONDA2_HOME/bin/python
export SPARK_HOME=/usr/hdp/current/spark2-client
export PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.4-src.zip
export PATH=$JAVA_HOME/bin:$ANACONDA2_HOME/bin:$PATH
[root@10-112-41-157 .jupyterhub]# cat /root/.bashrc
# .bashrc # User specific aliases and functions alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i' # Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi # added by Anaconda3 installer
#export PATH="/letv/anaconda3/bin:$PATH"

7.启动jupyterhub

[root@10-112-41-157 .jupyterhub]# /letv/anaconda3/bin/python /letv/anaconda3/bin/jupyterhub --debug &

因为jupyterhub需要py3环境,而系统环境又必须为py2,所以直接指定jupyterhub启动环境为py3

8.ladp用户登录访问后显示httpd 500

需要在linux系统中使用useradd创建ladp用户,登陆web页面之后,然后start service即可

使用conda部署jupyterhub以及ladp验证的安装的更多相关文章

  1. Spark入门实战系列--2.Spark编译与部署(中)--Hadoop编译安装

    [注]该系列文章以及使用到安装包/测试数据 可以在<倾情大奉送--Spark入门实战系列>获取 .编译Hadooop 1.1 搭建环境 1.1.1 安装并设置maven 1. 下载mave ...

  2. Centos下堡垒机Jumpserver V3.0环境部署完整记录(1)-安装篇

    由于来源身份不明.越权操作.密码泄露.数据被窃.违规操作等因素都可能会使运营的业务系统面临严重威胁,一旦发生事故,如果不能快速定位事故原因,运维人员往往就会背黑锅.几种常见的运维人员背黑锅场景:1)由 ...

  3. [转帖]VMware Vsphere 6.0安装部署 (三) vCenter Server安装

    VMware Vsphere 6.0安装部署 (三) vCenter Server安装 2016年08月29日 14:59:14 dAng1r0Us 阅读数:72942   版权声明:本文为博主原创文 ...

  4. Docker应用部署实录(包含完善Docker安装步骤)

    Docker应用部署实录(包含完善Docker安装步骤) 前言 首先说一下这篇文章的来源.我之前接手的一个IOT项目,需要安装多个中控服务器.中控服务器需要安装RabbitMQ,Mysql,多个服务, ...

  5. Hyper-V上运行的Linux虚拟机验证是否安装了集成服务

    Hyper-V上运行的Linux虚拟机验证是否安装了集成服务 ps aux|grep "hv"root       311  0.0  0.0      0     0 ?     ...

  6. 如何验证docker-compose安装成功

    安装过程及如何验证docker-compose安装成功 步骤1: 通过运行 curl 从GitHub上进行安装下载 sudo curl -L "https://github.com/dock ...

  7. 自动化kolla-ansible部署ubuntu20.04+openstack-victoria之准备安装-09

    自动化kolla-ansible部署ubuntu20.04+openstack-victoria之准备安装-09 欢迎加QQ群:1026880196 进行交流学习 准备安装 #controller1 ...

  8. docker 部署vsftpd服务、验证及java ftp操作工具类

    docker部署vsftpd服务 新建ftp文件存储目录/home/ftp cd /home mkdir ftp 创建一个组,用于存放ftp用户 groupadd ftpgroups 创建ftp用户, ...

  9. 项目部署到tomcat,验证部署成功

    1.假设你已经知道打war包放上去了tomcat 下的webapps下 2. bin->启动startup.bat 3.浏览器中启动 http://ip:port    这个port是tomca ...

随机推荐

  1. RIME-使用小心得

    从4月份我才接触到RIME输入法,当时的感觉上相见恨晚的,现在感觉也不错,时至今日,想写点东西,也算是小感触吧. RIME称为中州韵输入法引擎,是开放源代码的输入法软件,其主页是http://rime ...

  2. @PostMapping

    @PostMapping映射一个POST请求 Spring MVC新特性 提供了对Restful风格的支持 @GetMapping,处理get请求 @PostMapping,处理post请求 @Put ...

  3. python request(HttpRequest对象)请求的属性、方法笔记

    1.属性 path:表示提交请求页面完整地址的字符串,不包括域名,如"/music/bands/the_beatles/". method:表示提交请求使用的HTTP方法.(GET ...

  4. Mac OS 10.15系统入门教程 系统语言输入法详解

    对于一些Mac新手来说呢还不知道偏好设置到底是什么?有什么用处?其实Mac系统内的几乎所有的系统相关的设置都会在系统偏好设置内出现. 切换系统语⾔在语言与地区设置中拖拽左侧的语言条目就可以切换系统的语 ...

  5. 【Shiro】SpringBoot集成Shiro

    项目版本: springboot2.x shiro:1.3.2 Maven配置: <dependency> <groupId>org.apache.shiro</grou ...

  6. 深度学习中的batch、epoch、iteration的含义

    深度学习的优化算法,说白了就是梯度下降.每次的参数更新有两种方式. 第一种,遍历全部数据集算一次损失函数,然后算函数对各个参数的梯度,更新梯度.这种方法每更新一次参数都要把数据集里的所有样本都看一遍, ...

  7. http 换成 https

    UPDATE SYS_MENU M SET M.href = ( SELECT CASE WHEN substr(N.href, 0, 5) = 'http:' THEN 'https:'||subs ...

  8. 洛谷 P3806 (点分治)

    题目:https://www.luogu.org/problem/P3806 题意:一棵树,下面有q个询问,问是否有距离为k的点对 思路:牵扯到树上路径的题都是一般都是点分治,我们可以算出所有的路径长 ...

  9. BUUCTF | SQL COURSE 1

    一开始还以为是在登录框进行注入,于是fuzzing了一下发现一个注入点都没有 1 and 1 1 and 0 1' and '1 1' and '0 1" and "1 1&quo ...

  10. 第七周编程总结&&实验报告五

    实验四 类的继承 实验目的 理解抽象类与接口的使用: 了解包的作用,掌握包的设计方法 实验要求 掌握使用抽象类的方法. 掌握使用系统接口的技术和创建自定义接口的方法. 了解 Java 系统包的结构. ...