使用conda部署jupyterhub以及ladp验证的安装
前提:机器安装有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-sql和hive也均需要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验证的安装的更多相关文章
- Spark入门实战系列--2.Spark编译与部署(中)--Hadoop编译安装
[注]该系列文章以及使用到安装包/测试数据 可以在<倾情大奉送--Spark入门实战系列>获取 .编译Hadooop 1.1 搭建环境 1.1.1 安装并设置maven 1. 下载mave ...
- Centos下堡垒机Jumpserver V3.0环境部署完整记录(1)-安装篇
由于来源身份不明.越权操作.密码泄露.数据被窃.违规操作等因素都可能会使运营的业务系统面临严重威胁,一旦发生事故,如果不能快速定位事故原因,运维人员往往就会背黑锅.几种常见的运维人员背黑锅场景:1)由 ...
- [转帖]VMware Vsphere 6.0安装部署 (三) vCenter Server安装
VMware Vsphere 6.0安装部署 (三) vCenter Server安装 2016年08月29日 14:59:14 dAng1r0Us 阅读数:72942 版权声明:本文为博主原创文 ...
- Docker应用部署实录(包含完善Docker安装步骤)
Docker应用部署实录(包含完善Docker安装步骤) 前言 首先说一下这篇文章的来源.我之前接手的一个IOT项目,需要安装多个中控服务器.中控服务器需要安装RabbitMQ,Mysql,多个服务, ...
- Hyper-V上运行的Linux虚拟机验证是否安装了集成服务
Hyper-V上运行的Linux虚拟机验证是否安装了集成服务 ps aux|grep "hv"root 311 0.0 0.0 0 0 ? ...
- 如何验证docker-compose安装成功
安装过程及如何验证docker-compose安装成功 步骤1: 通过运行 curl 从GitHub上进行安装下载 sudo curl -L "https://github.com/dock ...
- 自动化kolla-ansible部署ubuntu20.04+openstack-victoria之准备安装-09
自动化kolla-ansible部署ubuntu20.04+openstack-victoria之准备安装-09 欢迎加QQ群:1026880196 进行交流学习 准备安装 #controller1 ...
- docker 部署vsftpd服务、验证及java ftp操作工具类
docker部署vsftpd服务 新建ftp文件存储目录/home/ftp cd /home mkdir ftp 创建一个组,用于存放ftp用户 groupadd ftpgroups 创建ftp用户, ...
- 项目部署到tomcat,验证部署成功
1.假设你已经知道打war包放上去了tomcat 下的webapps下 2. bin->启动startup.bat 3.浏览器中启动 http://ip:port 这个port是tomca ...
随机推荐
- SQL执行顺序和coalesce以及case when的用法
1.mysql的执行顺序 from on join where group by having select distinct union //UNION 操作符用于合并两个或多个 SELECT ...
- Ubuntu14.04安装Ruby2.2方法
直接使用系统的sudo apt-get install ruby2.0安装后,ruby -v显示ruby的版本依然是ruby 1.9. 以下方法可以顺序地在Ubuntu14.04安装Ruby2.2 s ...
- JAVA代码覆盖率采集与分析方案
原文地址-> http://m.blog.csdn.net/article/details?id=48688763
- Laravel框架使用融云服务端SDK
方法一: 使用第三方依赖安装(在项目根目录) 第一步:安装 composer require latrell/rongcloud dev-master 第二步:更新依赖包 c ...
- auto_now_add与auto_now的区别
- Python内建模块--collections
python内建模块--collections collections是Python内建的一个集合模块,提供了许多有用的集合类. namedtuple 我们知道tuple可以表示不变集合,例如,一个点 ...
- sql语句中取整数和小数部分
sql 取整数去小数点 ,) ' Sql截取浮点小数位数,不四舍五入 ,) 结果:551.24 ,) 结果:551.23 第一个2表示截取2位 第二个0,1分别表示0是四舍五入,0以外是截取 如何分别 ...
- 【Linux】RedHat换源(转)
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 原本链接:https://blog.csdn.net/otmqixi/article/deta ...
- flutter页面布局一
Padding组件 在 html 中常见的布局标签都有 padding 属性,但是 Flutter 中很多 Widget 是没有 padding 属性.这个时候我们可以用 Padding 组件处理容器 ...
- CF 1172E Nauuo and ODT ——LCT
题目:http://codeforces.com/contest/1172/problem/E LCT好题. 考虑对每个颜色求出 “不是该颜色的点组成的连通块的 siz2 之和” .每个颜色用 LCT ...