社区提供的读写分离架构图以下:
经过架构图能够看到Kylin会访问两个集群的HDFS,建议两个集群的NameService务必不能相同,尤为是集群启用NameNode HA时,相同的NameService会致使组件在跨集群访问HDFS时因没法区分NameService而出现问题。javascript
两个集群:
cluster1(hive集群):hdfs.hive,yarn,zookeeper,mr
cluster2(hbase集群):hdfs,hbase,zookeeper,yarn,kylin
首先配一个KYLIN_HOME,配到KYLIN的主目录
咱们的kylin安装在cluster2上,只要在cluster2上面配置环境变量就能够了。
在cluster2上要配置不少cluster1的hadoo参数
我单首创建一个目录放在$KYLIN_HOME下,叫hadoop_conf,里面须要有这些文件css
下面解释一下哪些用cluster1的参数,哪些文件用cluster2的参数.。若是用cluster1的参数,直接从cluster1拷贝过来就好了。
这些文件都在$KYLIN/HOME/hadoop_conf这个目录下
core-site.xml----cluster1 这个里面配置了hdfs的地址
hbase-site.xml---cluster2
hdfs-site.xml----cluster2 这个里面配置了nameservice的参数,没有它没法解析nameservice
hive--site.xml---cluster1
mapred-site.xml--cluster1html
咱们用kylin用户去启动及服务,因此配置一下kylin用户环境变量,修改 ~/.bashrc 这个文件
添加上这些
export HBASE_CONF_DIR=$KYLIN/HOME_hadoop_conf
export HIVE_CONF=$KYLIN/HOME_hadoop_conf
export HADOOP_CONF_DIR=$KYLIN_HOME/hadoop_conf
!!!!!!!!!!!!!!
export HBASE_CONF_DIR=$KYLIN_HOMEhadoop_conf
这个HBASE_CONF_DIR很重要,由于kylin是用过HBASE去读取hdfs--site和core-site.xml这两个文件从而读取HDFS的环境变量的,不加的话默认会读CDH目录下HBASE的配置,我由于这个东西卡了好几天,加了好几天班才发现。好想哭。。。。而KYLIN官方根本没有写,坑爹啊。。
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!前端
配置conf/kylin.properties和tomcat/conf/server.xml
conf/kylin.properties根据本身须要去配置,主要配置下hive和hbase的相关参数,
tomcat/conf/server.xml主要有2个地方须要注意:
1.keystore
<Connector port="7443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
keystoreFile="conf/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS" />
须要去生成相应的keystore文件,或者直接把这段注释掉java
2.我在测试环境上没有修改这个能够正常运行,在生产机部署的时候,打开前端的ui,出现没法加载models,配置,和环境变量的问题,同时会在前台弹出“failed to take actions”的提示
通过好几天的查找,发现是前端获取资源在解压缩的时候出现问题,把压缩关掉
在
<Connector port="7070" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="7443"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla,traviata"
compressableMimeType="text/html,text/xml,text/javascript,application/javascript,application/json,text/css,text/plain"
/>中
把compression="on"改成 compression="off"sql
修改KYLIN_HOME/conf/kylin.perproties,apache
kylin.source.hive.client=beelinejson
##jdbc的url改成cluster1的hive地址
kylin.source.hive.beeline-params=-n root --hiveconf hive.security.authorization.sqlstd.confwhitelist.append='mapreduce.job.|dfs.' -u jdbc:hive2://stream3:25002tomcat
##改成cluster2的hdfs地址
kylin.storage.hbase.cluster-fs=hdfs://stream-master1:8020bash
另外我在build任务过程当中第16步失败,缘由是分配资源不够,在KYLIN_HOIME/conf/kylin_job_conf.xml中添加一下mapreduce.map.memory.mb和mapreduce.reduce.memory.mb的这两个参数,把值配大一点就行了。
而后启动就能够了。