kylin安装 和kylin用户权限管理

 

安装Apache-kylin -->apache-kylin-1.6.0-cdh5.7-bin.tar.gz

注意:本步骤的kylin路径和 HCAT_HOME的路径要根据线上来定

1..1解压kylin到/usr/bin

1.2设置环境变量

export KYLIN_HOME=/usr/bin/apache-kylin-1.6.0-cdh5.7-bin

PATH=$PATH:$KYLIN_HOME

export HCAT_HOME=/opt/cloudera/parcels/CDH/lib/hive-hcatalog

PATH=$PATH:$HCAT_HOME

1.3启动kylin

$KYLIN_HOME/bin/kylin.sh start

1.4 登录到kylin的webUI界面(此处的ip为部署kylin 的ip地址)

clip_image002

用户名ADMIN

密码KYLIN

 

如果报权限错误,请使用hdfs用户启动程序

chmod -R hdfs:hdfs $KYLIN_HOME  

 

Kylin如何添加登录用户

官方doc给出解决思路:Kylin是采用Spring security framework做用户认证的,需要配置${KYLIN_HOME}/tomcat/webapps/kylin/WEB-INF/classes/kylinSecurity.xml 的sandbox,testing部分

<beans profile="sandbox,testing">
    <scr:authentication-manager alias="authenticationManager">
        <scr:authentication-provider>
            <scr:user-service>
                ...
                <scr:user name="ADMIN" password="$2a$10$o3ktIWsGYxXNuUWQiYlZXOW5hWcqyNAFQsSSCSEWoC/BRVMAUjL32" authorities="ROLE_MODELER, ROLE_ANALYST, ROLE_ADMIN" />
                <scr:user name="xxx" password="xxx" authorities="ROLE_MODELER, ROLE_ANALYST, ROLE_ADMIN" />
                ...

password需要spring加密:

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>4.0.0.RELEASE</version>
</dependency>
String password = "123456"; 
org.springframework.security.crypto.password.PasswordEncoder encoder
   = new org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder();
String encodedPassword = encoder.encode(password);  
System.out.print(encodedPassword);

您可以选择一种方式赞助本站