- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Is Zeppelin in HDP 2.5 support multi-tenancy on a Kerberized Cluster
- Labels:
-
Apache Zeppelin
Created ‎11-10-2016 04:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are looking at setting up Zeppelin on top of Livy Server. Does the following settings pass also the kerberos authentication information.
<property> <name>hadoop.proxyuser.livy.groups</name> <value>*</value> </property> <property> <name>hadoop.proxyuser.livy.hosts</name> <value>*</value> </property>
Created ‎11-10-2016 06:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Deepak, see my how-to tutorial:
If you are using self-signed certificate, Download the SSL certificate to where zeppelin is running
- <code>mkdir -p /etc/security/certificates
store the certificate in this directory
Import certificate for zeppelin to work with the self signed certificate.
- <code>cd /etc/security/certificates
- keytool -import -alias sampledcfieldcloud -file ad01.your.domain.name.cer -keystore /usr/jdk64/jdk1.8.0_77/jre/lib/security/cacerts
- keytool -list -v -keystore /usr/jdk64/jdk1.8.0_77/jre/lib/security/cacerts | grep sampledcfieldcloud
Create home directory in hdfs for the user that you will login:
- <code>hdfs dfs -mkdir /user/hadoopadmin
- hdfs dfs -chown hadoopadmin:hdfs /user/hadoopadmin
Enable multi-user zeppelin use ambari -> zeppelin notebook configs
expand the Advanced zeppelin-env and look for shiro.ini entry. Below is configuration that works with our sampledcfield Cloud.
- <code>[users]
- # List of users with their password allowed to access Zeppelin.
- # To use a different strategy (LDAP / Database / ...) check the shiro doc at http://shiro.apache.org/configuration.html#Configuration-INISections
- #admin = password1
- #user1 = password2, role1, role2
- #user2 = password3, role3
- #user3 = password4, role2
- # Sample LDAP configuration, for user Authentication, currently tested for single Realm
- [main]
- activeDirectoryRealm = org.apache.zeppelin.server.ActiveDirectoryGroupRealm
- #activeDirectoryRealm.systemUsername = CN=binduser,OU=ServiceUsers,DC=sampledcfield,DC=hortonworks,DC=com
- activeDirectoryRealm.systemUsername = binduser
- activeDirectoryRealm.systemPassword = xxxxxx
- activeDirectoryRealm.principalSuffix = @your.domain.name
- #activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://user/zeppelin/zeppelin.jceks
- activeDirectoryRealm.searchBase = DC=sampledcfield,DC=hortonworks,DC=com
- activeDirectoryRealm.url = ldaps://ad01.your.domain.name:636
- activeDirectoryRealm.groupRolesMap = "CN=hadoop-admins,OU=CorpUsers,DC=sampledcfield,DC=hortonworks,DC=com":"admin"
- activeDirectoryRealm.authorizationCachingEnabled = true
- sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
- cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
- securityManager.cacheManager = $cacheManager
- securityManager.sessionManager = $sessionManager
- securityManager.sessionManager.globalSessionTimeout = 86400000
- #ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm
- #ldapRealm.userDnTemplate = uid={0},cn=users,cn=accounts,dc=example,dc=com
- #ldapRealm.contextFactory.url = ldap://ldaphost:389
- #ldapRealm.contextFactory.authenticationMechanism = SIMPLE
- #sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
- #securityManager.sessionManager = $sessionManager
- # 86,400,000 milliseconds = 24 hour
- #securityManager.sessionManager.globalSessionTimeout = 86400000
- shiro.loginUrl = /api/login
- [roles]
- admin = *
- [urls]
- # anon means the access is anonymous.
- # authcBasic means Basic Auth Security
- # To enfore security, comment the line below and uncomment the next one
- /api/version = anon
- /api/interpreter/** = authc, roles[admin]
- /api/credential/** = authc, roles[admin]
- /api/configurations/** = authc, roles[admin]
- #/** = anon
- /** = authc
- #/** = authcBasic
Grant Livy ability to impersonate
Use Ambari to update core-site.xml, restart YARN & HDFS after making this change.
- <code><property>
- <name>hadoop.proxyuser.livy.groups</name>
- <value>*</value>
- </property>
- <property>
- <name>hadoop.proxyuser.livy.hosts</name>
- <value>*</value>
- </property>
Restart hdfs and yarn after this update.
After running the livy notebook make sure the yarn logs show the logged in user as the user that is running, hadoopadmin is the user that is logged in the zeppelin notebook. You should see 2 applications running the livy-session-X and the zeppelin app running in yarn
- <code>application_1478287338271_0003 hadoopadmin livy-session-0
- application_1478287338271_0002 zeppelin Zeppelin
Created ‎11-10-2016 06:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Deepak, see my how-to tutorial:
If you are using self-signed certificate, Download the SSL certificate to where zeppelin is running
- <code>mkdir -p /etc/security/certificates
store the certificate in this directory
Import certificate for zeppelin to work with the self signed certificate.
- <code>cd /etc/security/certificates
- keytool -import -alias sampledcfieldcloud -file ad01.your.domain.name.cer -keystore /usr/jdk64/jdk1.8.0_77/jre/lib/security/cacerts
- keytool -list -v -keystore /usr/jdk64/jdk1.8.0_77/jre/lib/security/cacerts | grep sampledcfieldcloud
Create home directory in hdfs for the user that you will login:
- <code>hdfs dfs -mkdir /user/hadoopadmin
- hdfs dfs -chown hadoopadmin:hdfs /user/hadoopadmin
Enable multi-user zeppelin use ambari -> zeppelin notebook configs
expand the Advanced zeppelin-env and look for shiro.ini entry. Below is configuration that works with our sampledcfield Cloud.
- <code>[users]
- # List of users with their password allowed to access Zeppelin.
- # To use a different strategy (LDAP / Database / ...) check the shiro doc at http://shiro.apache.org/configuration.html#Configuration-INISections
- #admin = password1
- #user1 = password2, role1, role2
- #user2 = password3, role3
- #user3 = password4, role2
- # Sample LDAP configuration, for user Authentication, currently tested for single Realm
- [main]
- activeDirectoryRealm = org.apache.zeppelin.server.ActiveDirectoryGroupRealm
- #activeDirectoryRealm.systemUsername = CN=binduser,OU=ServiceUsers,DC=sampledcfield,DC=hortonworks,DC=com
- activeDirectoryRealm.systemUsername = binduser
- activeDirectoryRealm.systemPassword = xxxxxx
- activeDirectoryRealm.principalSuffix = @your.domain.name
- #activeDirectoryRealm.hadoopSecurityCredentialPath = jceks://user/zeppelin/zeppelin.jceks
- activeDirectoryRealm.searchBase = DC=sampledcfield,DC=hortonworks,DC=com
- activeDirectoryRealm.url = ldaps://ad01.your.domain.name:636
- activeDirectoryRealm.groupRolesMap = "CN=hadoop-admins,OU=CorpUsers,DC=sampledcfield,DC=hortonworks,DC=com":"admin"
- activeDirectoryRealm.authorizationCachingEnabled = true
- sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
- cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
- securityManager.cacheManager = $cacheManager
- securityManager.sessionManager = $sessionManager
- securityManager.sessionManager.globalSessionTimeout = 86400000
- #ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm
- #ldapRealm.userDnTemplate = uid={0},cn=users,cn=accounts,dc=example,dc=com
- #ldapRealm.contextFactory.url = ldap://ldaphost:389
- #ldapRealm.contextFactory.authenticationMechanism = SIMPLE
- #sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
- #securityManager.sessionManager = $sessionManager
- # 86,400,000 milliseconds = 24 hour
- #securityManager.sessionManager.globalSessionTimeout = 86400000
- shiro.loginUrl = /api/login
- [roles]
- admin = *
- [urls]
- # anon means the access is anonymous.
- # authcBasic means Basic Auth Security
- # To enfore security, comment the line below and uncomment the next one
- /api/version = anon
- /api/interpreter/** = authc, roles[admin]
- /api/credential/** = authc, roles[admin]
- /api/configurations/** = authc, roles[admin]
- #/** = anon
- /** = authc
- #/** = authcBasic
Grant Livy ability to impersonate
Use Ambari to update core-site.xml, restart YARN & HDFS after making this change.
- <code><property>
- <name>hadoop.proxyuser.livy.groups</name>
- <value>*</value>
- </property>
- <property>
- <name>hadoop.proxyuser.livy.hosts</name>
- <value>*</value>
- </property>
Restart hdfs and yarn after this update.
After running the livy notebook make sure the yarn logs show the logged in user as the user that is running, hadoopadmin is the user that is logged in the zeppelin notebook. You should see 2 applications running the livy-session-X and the zeppelin app running in yarn
- <code>application_1478287338271_0003 hadoopadmin livy-session-0
- application_1478287338271_0002 zeppelin Zeppelin
Created ‎11-10-2016 06:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @azeltov. To confirm. Does it also work with a Kerberized Cluster ?I am just wondering how the kerberos information is passed.
Created ‎11-11-2016 12:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It does work in Kerberized cluster you will need to create keytabs for zeppelin and livy service account.
Created ‎11-15-2016 03:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @azeltov . Even if we create a kerberos token for zeppelin, how does the kerberos tokens for individual users is passed ? All the access to HDFS, Spark and Hive is managed in Ranger for AD user or group and not for Zeppelin user.
Created ‎11-15-2016 04:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You must use Livy integration for the user tokens to be passed.
Created ‎01-26-2017 12:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The tokens aren't passed. zeppelin authenticates itself with livy and as it is a superuser (livy.superusers) livy takes the proxyUser sent by zeppelin and becomes that user.
