Skip to content
4 changes: 2 additions & 2 deletions ranger-atlas/HortoniaMunichSetup/10-SSOSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ keytool -genkey -alias knoxidentity -keyalg RSA -keysize 1024 -dname CN=knoxiden
keytool -export -alias knoxidentity -keystore /tmp/knoxidentity.jks -rfc -file knox.cert -storepass knoxsecret
#Certificate to distribute to services
knox_cert=$(cat /tmp/knox.cert | grep -v "BEGIN CERTIFICATE" | grep -v "END CERTIFICATE"|sed 's/\r//g' )
hostname=$(hostname -f)
knox_hostname=demo.hortonworks.com
#Provider URL for SSO
knox_sso_url="https://$hostname:8443/gateway/knoxsso/api/v1/websso"
knox_sso_url="https://${knox_hostname}:8443/gateway/knoxsso/api/v1/websso"

echo "Create knoxidentity alias"
/usr/hdp/current/knox-server/bin/knoxcli.sh create-alias knoxidentity --value knoxsecret
Expand Down
3 changes: 2 additions & 1 deletion ranger-atlas/HortoniaMunichSetup/11-KNOX-UI-proxySetup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
export cluster_name=$1
export knox_host=demo.hortonworks.com
export host=$(hostname -f)
export ambari_pass=$2

Expand Down Expand Up @@ -79,7 +80,7 @@ cat << EOF > cookieprovider.xml
<enabled>true</enabled>
<param>
<name>sso.authentication.provider.url</name>
<value>https://${host}:8443/gateway/knoxsso/api/v1/websso</value>
<value>https://${knox_host}:8443/gateway/knoxsso/api/v1/websso</value>
</param>
</provider>
<provider>
Expand Down
13 changes: 7 additions & 6 deletions ranger-atlas/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export deploy=true

export host=$(hostname -f)
export ambari_host=$(hostname -f)

export knox_host=demo.hortonworks.com
export install_ambari_server ambari_pass host_count ambari_services
export ambari_password cluster_name recommendation_strategy

Expand All @@ -59,7 +59,7 @@ curl -sSL https://raw.githubusercontent.com/seanorama/ambari-bootstrap/master/ex

#download hortonia scripts
cd /tmp
git clone https://github.com/abajwa-hw/masterclass
git clone -b patch-1 https://github.com/jnowakowski/masterclass.git

cd /tmp/masterclass/ranger-atlas/HortoniaMunichSetup
chmod +x *.sh
Expand Down Expand Up @@ -304,10 +304,11 @@ EOF
/var/lib/ambari-server/resources/scripts/configs.py -u admin -p ${ambari_pass} --host localhost --port 8080 --cluster ${cluster_name} -a set -c zeppelin-shiro-ini -f /tmp/zeppelin-env.json
sleep 5

# Install shell interpreter into Zeppelin
/usr/hdp/current/zeppelin-server/bin/install-interpreter.sh --name shell


#restart Zeppelin
sudo curl -u admin:${ambari_pass} -H 'X-Requested-By: blah' -X POST -d "
#restart Zeppelin
sudo curl -u admin:${ambari_pass} -H 'X-Requested-By: blah' -X POST -d "
{
\"RequestInfo\":{
\"command\":\"RESTART\",
Expand Down Expand Up @@ -691,7 +692,7 @@ if [ "${enable_knox_sso_proxy}" = true ]; then
./11-KNOX-UI-proxySetup.sh ${cluster_name} ${ambari_pass}

#echo "Setting up Zeppelin SSO"
./12-enable-zeppelin_SSO.sh ${cluster_name} ${ambari_pass} "https://$(hostname -f):8443/gateway/knoxsso/api/v1/websso"
./12-enable-zeppelin_SSO.sh ${cluster_name} ${ambari_pass} "https://${knox_host}:8443/gateway/knoxsso/api/v1/websso"

#when using SSO, startup script shouldn't change Ambari pass
touch /root/.firstbootdone
Expand Down