不多說,直接上干貨!
我的集群機器情況是 bigdatamaster(192.168.80.10)、bigdataslave1(192.168.80.11)和bigdataslave2(192.168.80.12)
然后,安裝目錄是在/home/hadoop/app下。
官方建議在master機器上安裝Hue,我這里也不例外。安裝在bigdatamaster機器上。
Hue版本:hue-3.9.0-cdh5.5.4
需要編譯才能使用(聯網)
說給大家的話:大家電腦的配置好的話,一定要安裝cloudera manager。畢竟是一家人的。
同時,我也親身經歷過,會有部分組件版本出現問題安裝起來要個大半天時間去排除,做好心里准備。廢話不多說,因為我目前讀研,自己筆記本電腦最大8G,只能玩手動來練手。
純粹是為了給身邊沒高配且條件有限的學生黨看的! 但我已經在實驗室機器群里搭建好cloudera manager 以及 ambari都有。
大數據領域兩大最主流集群管理工具Ambari和Cloudera Manger
Cloudera安裝搭建部署大數據集群(圖文分五大步詳解)(博主強烈推薦)
Ambari安裝搭建部署大數據集群(圖文分五大步詳解)(博主強烈推薦)
https://www.cloudera.com/documentation/enterprise/latest/topics/cdh_ig_hue_config.html#concept_ezg_b2s_hl
在hbase模塊里,一定要重視這三步:
首先,來看看官網的參考步驟
一、以下是默認的配置文件
########################################################################### # Settings to configure HBase Browser ########################################################################### [hbase] # Comma-separated list of HBase Thrift servers for clusters in the format of '(name|host:port)'. # Use full hostname with security. # If using Kerberos we assume GSSAPI SASL, not PLAIN. ## hbase_clusters=(Cluster|localhost:9090) # HBase configuration directory, where hbase-site.xml is located. ## hbase_conf_dir=/etc/hbase/conf # Hard limit of rows or columns per row fetched before truncating. ## truncate_limit = 500 # 'buffered' is the default of the HBase Thrift Server and supports security. # 'framed' can be used to chunk up responses, # which is useful when used in conjunction with the nonblocking server in Thrift. ## thrift_transport=buffered
二、以下是跟我機器集群匹配的配置文件(非HA集群下怎么配置Hue的hbase模塊)
HBase配置文件修改,需要在hbase-site.xml中增加如下東西。
<property> <name>hbase.thrift.support.proxyuser</name> <value>true</value> </property> <property> <name>hbase.regionserver.thrift.http</name> <value>true</value> </property>
這里bigdatamaster、bigdataslave1和bigdataslave2都操作。
同時,前提是這些機器,都要已經安裝過hbase-thrift。
yum install hbase-thrift -y
這里bigdatamaster、bigdataslave1和bigdataslave2都操作。(有些資料說,是這樣安裝。其實,現在HBase里都可以自帶集成好了,沒必要這么安裝了)
大家,學東西時,一定不要似懂非懂,明白個之所以然。
為什么要添加這些東西,因為HUE要訪問HBase的thrift服務。
參見:http://gethue.com/hbase-browsing-with-doas-impersonation-and-kerberos/
這邊的 (Cluster|bigdatamaster:9090) 里面的 Cluster並不是你的HDFS集群名字,只是一個顯示在HUE界面上的文字,所以可以隨便寫,我這邊保留 Cluster字樣,后面的bigdatamaster:9090是thrift的訪問地址,如果有多個用逗號分隔。如下:
###########################################################################
# Settings to configure HBase Browser
###########################################################################
[hbase]
# Comma-separated list of HBase Thrift servers for clusters in the format of '(name|host:port)'. # Use full hostname with security. # If using Kerberos we assume GSSAPI SASL, not PLAIN. hbase_clusters=(Cluster1|bigdatamaster:9090,Cluster2|bigdataslave1:9090,Cluster3|bigdataslave2:9090) # HBase configuration directory, where hbase-site.xml is located. hbase_conf_dir=/home/hadoop/app/hbase/conf/ # Hard limit of rows or columns per row fetched before truncating. truncate_limit = 500 # 'buffered' is the default of the HBase Thrift Server and supports security. # 'framed' can be used to chunk up responses, # which is useful when used in conjunction with the nonblocking server in Thrift. thrift_transport=buffered
或者
當然咯,大家也可以僅僅只在bigdatamaster上安裝hbase-thrift,然后在Hue里配置時,如下即可。
HBase配置文件修改,需要在hbase-site.xml中增加如下東西。
<property> <name>hbase.thrift.support.proxyuser</name> <value>true</value> </property> <property> <name>hbase.regionserver.thrift.http</name> <value>true</value> </property>
這里只在bigdatamaster操作。
同時,前提是只要這台機器,已經安裝過hbase-thrift。
yum install hbase-thrift -y
這里僅僅bigdatamaster操作。(有些資料說,是這樣安裝。其實,現在HBase里都可以自帶集成好了,沒必要這么安裝了)
修改【HUE_HOME/desktop/conf/】目錄下的hue.ini文件中[hbase]中的配置
HUE 配置文件設置,找到hbase標簽,配置如下
########################################################################### # Settings to configure HBase Browser ########################################################################### [hbase] # Comma-separated list of HBase Thrift servers for clusters in the format of '(name|host:port)'. # Use full hostname with security. # If using Kerberos we assume GSSAPI SASL, not PLAIN. hbase_clusters=(Cluster|bigdatamaster:9090) # HBase configuration directory, where hbase-site.xml is located. hbase_conf_dir=/home/hadoop/app/hbase/conf # Hard limit of rows or columns per row fetched before truncating. ## truncate_limit = 500 # 'buffered' is the default of the HBase Thrift Server and supports security. # 'framed' can be used to chunk up responses, # which is useful when used in conjunction with the nonblocking server in Thrift. thrift_transport=buffered
注意:hbase_clusters參數值中的Cluster只是在Hue的界面中顯示的集群名稱而已,可以修改成自己需要的。
也就是說,一般保持默認Cluster。即我這里是,Cluster包括bigdatamaster、bigdataslave1和bigdataslave2。
而,我的hbase是安裝在bigdatamaster、bigdataslave1和bigdataslave2上。
需要啟動HBase的進程服務
[hadoop@bigdatamaster hbase]$ pwd /home/hadoop/app/hbase [hadoop@bigdatamaster hbase]$ bin/start-hbase.sh starting master, logging to /home/hadoop/app/hbase/logs/hbase-hadoop-master-bigdatamaster.out bigdataslave1: starting regionserver, logging to /home/hadoop/app/hbase/bin/../logs/hbase-hadoop-regionserver-bigdataslave1.out bigdataslave2: starting regionserver, logging to /home/hadoop/app/hbase/bin/../logs/hbase-hadoop-regionserver-bigdataslave2.out [hadoop@bigdatamaster hbase]$
只需bigdatamaster操作就好。
因為,是需要在hbase集群已經啟動的基礎上,再啟動thrift,默認端口為9090。
還需要啟動HBase的thrift服務
$HBASE_HOME/bin/hbase-daemon.sh start thrift
[hadoop@bigdatamaster hbase]$ pwd /home/hadoop/app/hbase [hadoop@bigdatamaster hbase]$ $HBASE_HOME/bin/hbase-daemon.sh start thrift starting thrift, logging to /home/hadoop/app/hbase/logs/hbase-hadoop-thrift-bigdatamaster.out [hadoop@bigdatamaster hbase]$
這個操作,bigdatamaster、bigdataslave1和bigdataslave2都操作。(如果只安裝在bigdatamaster的話,就只需要啟動這台即可。)
對於上述做個總結
一般在Hue里配置hbase模塊,無論是我這篇博客,還是網上其他相當的博客都是只配置到此為止,可以把HBase配置成功了。
但是呢,我這里,帶大家進一步從官網深入來配置。
https://www.cloudera.com/documentation/enterprise/latest/topics/cdh_ig_hue_config.html#concept_ezg_b2s_hl
配置到hbase-site.xml里
<property> <name>hbase.security.authentication</name> <value>kerberos</value> </property> <property> <name>hbase.regionserver.kerberos.principal</name> <value>hbase/_HOST@HADOOP.COM</value> </property> <property> <name>hbase.regionserver.keytab.file</name> <value>/home/hadoop/app/hbase/conf/hbase.keytab</value> </property> <property> <name>hbase.master.kerberos.principal</name> <value>hbase/_HOST@HADOOP.COM</value> </property> <property> <name>hbase.master.keytab.file</name> <value>/home/hadoop/app/hbase/conf/hbase.keytab</value> </property>
這一步,是有點難度,要開啟kerberos。我這里暫時還沒搞定這點。
http://www.tuicool.com/articles/YVbmIzm
因為,要牽扯到,Kerberos server的安裝等,
https://yq.aliyun.com/articles/25542
三、以下是跟我機器集群匹配的配置文件(HA集群下怎么配置Hue的hbase模塊)
跟非HA配置是一樣的。
########################################################################### # Settings to configure HBase Browser ########################################################################### [hbase] # Comma-separated list of HBase Thrift servers for clusters in the format of '(name|host:port)'. # Use full hostname with security. # If using Kerberos we assume GSSAPI SASL, not PLAIN. hbase_clusters=(Cluster|bigdata-pro01.kfk.com:9090) # HBase configuration directory, where hbase-site.xml is located. hbase_conf_dir=/opt/modules/hbase-0.98.6-cdh5.3.0/conf # Hard limit of rows or columns per row fetched before truncating. ## truncate_limit = 500 # 'buffered' is the default of the HBase Thrift Server and supports security. # 'framed' can be used to chunk up responses, # which is useful when used in conjunction with the nonblocking server in Thrift. ## thrift_transport=buffered
然后,停掉hbase進程,再開啟hbase進程。
因為,我的HBase是HA集群。
所以先在主節點1上,啟動hbase
然后,再在主節點2上啟動hbase
具體,啟動,見
Apache版本的Hadoop HA集群啟動詳細步驟【包括Zookeeper、HDFS HA、YARN HA、HBase HA】(圖文詳解)
再開啟hbase的thrift服務
同時,大家可以關注我的個人博客:
http://www.cnblogs.com/zlslch/ 和 http://www.cnblogs.com/lchzls/ http://www.cnblogs.com/sunnyDream/
詳情請見:http://www.cnblogs.com/zlslch/p/7473861.html
人生苦短,我願分享。本公眾號將秉持活到老學到老學習無休止的交流分享開源精神,匯聚於互聯網和個人學習工作的精華干貨知識,一切來於互聯網,反饋回互聯網。
目前研究領域:大數據、機器學習、深度學習、人工智能、數據挖掘、數據分析。 語言涉及:Java、Scala、Python、Shell、Linux等 。同時還涉及平常所使用的手機、電腦和互聯網上的使用技巧、問題和實用軟件。 只要你一直關注和呆在群里,每天必須有收獲
對應本平台的討論和答疑QQ群:大數據和人工智能躺過的坑(總群)(161156071)