Create Jupyterhub Container on Centos 7 on Proxmox

These instructions show how to create a Centos 7 container on Proxmox running JupyterHub.

Note Рthe instructions are just a guide and for use on my environment Рyou may need/wish to adjust for your own environment as necessary.


root@billy:~# pveversion
pve-manager/4.4-12/e71b7a74 (running kernel: 4.4.40-1-pve)
The version of the notebook server is 4.4.1
Python 3.4.5 (default, Nov  9 2016, 16:24:59) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]

Create Container

pct create 153 u01:vztmpl/centos-7-default_20160205_amd64.tar.xz -rootfs 10 -hostname jupyterhub -memory 2048 -nameserver -searchdomain -net0 name=eth0,bridge=vmbr0,gw=,ip= -swap 2048 -cpulimit 2 -storage u01


Update system

yum update -y
yum install epel-release -y
yum install
wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle 

Install JDK

wget -y cd ~ wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" "" 
yum localinstall jdk-8u111-linux-x64.rpm -y 
rm -f ~/jdk-8u111-linux-x64.rpm 
vi /etc/environment export 
vi ~/.bash_profile 
 export PATH=${JAVA_HOME}/bin:$PATH 
. ~/.bash_profile 
java -version 

Install Oracle 7 Linux repo (works for Centos 7)

wget yum 

Install Python 3 And Jupyter Notebook

install python34 -y 
curl -O /usr/bin/python3.4 
yum install npm nodejs-legacy -y
yum install anaconda -y 
python3 -m pip install jupyterhub 
npm config set strict-ssl false 
npm install -g configurable-http-proxy 
python3 -m pip install notebook 
yum install oracle-instantclient12.1-basic- -y 
yum install oracle-instantclient12.1-devel- -y 
yum install oracle-instantclient12.1-sqlplus- -y 
vi ~/.bash_profile 
  export ORACLE_HOME=/usr/lib/oracle/12.1/client64 
  export PATH=$ORACLE_HOME/bin:$PATH 
vi /etc/environment 
  export ORACLE_HOME=/usr/lib/oracle/12.1/client64 
  export PATH=$ORACLE_HOME/bin:$PATH 
. ~/.bash_profile 
yum install gcc -y 
yum install python-devel -y 
yum install python34-devel -y 
pip install cx_Oracle
pip install ipython-sql 
jupyterhub --generate-config 
vi /root/ # ensure the following are set: 
  c.Spawner.env_keep = ['LD_LIBRARY_PATH'] 
  c.Spawner.environment = dict(LD_LIBRARY_PATH='/usr/lib/oracle/12.1/client64/lib:$LD_LIBRARY_PATH') 
systemctl stop firewalld 
systemctl disable firewalld 
vi /lib/systemd/system/jupyterhub.service 
  User=root ExecStart=/usr/bin/jupyterhub --ip= 
systemctl enable jupyterhub 
systemctl start jupyterhub 
systemctl status jupyterhub

That should be it…navigate to and login with a unix user on that node.

RAC aware SLOB2 analyze script (Flash DBA)

I’ve been using the very useful scripts from FlashDBA to run SLOB2 on our new system, but unfortunately the analyze one is not RAC aware, so I’ve modified it, in very minor ways, such that it can use an AWR Global report (awrgrpt.sql) as input and still extract the same values that the original does.

I call the script

Here is an example run – ignore the numbers as they are not representative of anything in particular. ./ rac_awr_12jul2013/awr.20.032/awr.20.032.txt > slob.csv
Info : Analyzing file rac_awr_12jul2013/awr.20.032/awr.20.032.txt
Info : Filename = awr.20.032.txt
Info : Update Pct = 20
Info : Workers = 032
Info : Read IOPS = 85.8
Info : Write IOPS = 33.0
Info : Redo IOPS = 15.6
Info : Total IOPS = 134.4
Info : Read Num Waits = 712
Info : Read Wait Time = 0.58
Info : Read Latency us = 814.606
Info : Write Num Waits = 926
Info : Write Wait Time = 0.28
Info : Write Latency us = 302.375
Info : Redo Num Waits = 2043
Info : Redo Wait Time = 0.37
Info : Redo Latency us = 181.106
Info : Num CPUs = 384
Info : Num CPU Cores = 192
Info : Num CPU Sockets = 24
Info : Linux Version = Red Hat Enterprise Linux Server release 6.3 (Santiago)
Info : Kernel Version = 2.6.32-279.2.1.el6.x86_64
Info : Processor Type = Intel(R) Xeon(R) CPU E7- 2830 @ 2.13GHz
Info : SLOB Run Time = 300
Info : SLOB Work Loop = 0
Info : SLOB Scale = 10000
Info : SLOB Work Unit = 256
Info : SLOB Redo Stress = LIGHT
Info : SLOB Shared Data Mod = 0
Info : No more files found
Info : =============================
Info : AWR Files Found = 1
Info : AWR Files Processed = 1
Info : Errors Experienced = 0
Info : =============================

Jonathan Lewis has a nice article covering the different AWR Reports.

I’ve only tested it on the system at work and it seems to work OK – your mileage may vary and I’d be happy to hear comments to the contrary, in relation to the changes I’ve made for use on RAC, but obviously the script is still 99% unchanged, so please contact FlashDBA if there are any generic issues you want to raise.

I’m not a unix shell script guy, but it seems to work…see what you think.