不多说,直接上干货!
写在前面的话
我这里,四个节点的bigdata集群。分别为cmbigdata1、cmbigdata2、cmbigdata3和cmbigdata4。
https://i.cnblogs.com/posts?categoryid=916378
CentOS6.5下Cloudera安装搭建部署大数据集群(图文分五大步详解)(博主强烈推荐)
其中,cmbigdata1即做server,又做agent。
cmbigdata2、cmbigdata3和cmbigdata4都是做agent。
注意:
CDH版本的Phoenix的安装,需要我们自己编译。
1、下载
https://github.com/chiastic-security/phoenix-for-cloudera/tree/4.8-HBase-1.2-cdh5.8
2、编译(编译时间较长,耐心等待)
mvn clean package -DskipTests
3、解压
将编译好的phoenix-4.8.0-cdh5.8.0.tar.gz解压出来
[root@cmbigdata1 phoenix]# tar -zxvf phoenix-4.8.-cdh5.8.0.tar.gz
[root@cmbigdata1 phoenix]# cd phoenix-4.8.-cdh5.8.0
[root@cmbigdata1 phoenix-4.8.-cdh5.8.0]# ll
total
drwxr-xr-x root root Apr : bin
-rw-r--r-- root root Aug build.txt
drwxr-xr-x root root Aug dev
drwxr-xr-x root root Aug docs
drwxr-xr-x root root Aug examples
drwxr-xr-x root root Apr : lib
-rw-r--r-- root root Apr : phoenix-4.8.-cdh5.8.0-client.jar
-rw-r--r-- root root Apr : phoenix-4.8.-cdh5.8.0-queryserver.jar
-rw-r--r-- root root Apr : phoenix-4.8.-cdh5.8.0-server.jar
-rw-r--r-- root root Apr : phoenix-4.8.-cdh5.8.0-thin-client.jar
4、将phoenix-4.8.0-cdh5.8.0-server.jar拷贝到每一个RegionServer下
[root@cmbigdata2~]# find / -name 'phoenix-4.8.0-cdh5.8.0-server.jar'
/soft/bigdata/clouderamanager/cloudera/parcels/CDH-5.10.-.cdh5.10.0.p0./lib/hbase/lib/phoenix-4.8.-cdh5.8.0-server.jar
cmbigdata2和cmbigdata3和cmbigdata4一样。
5、增加hbase-site.xml 配置
<property>
<name>hbase.table.sanity.checks</name>
<value>false</value>
</property>
在集群管理页面点击Hbase,进入Hbase管理界面
点击配置:
选择高级:
增加如下配置:
6、重启Hbase
这个很简单,不多说,会玩cloudermanager的人都知道。
7、登录phoenix
进入phoenix-4.8.0-cdh5.8.0/bin目录执行。
[root@cmbigdata1 phoenix-4.8.-cdh5.8.0]# cd /soft/phoenix/phoenix-4.8.-cdh5.8.0/bin/
[root@cmbigdata1 bin]# ll
total
-rwxr-xr-x root root Aug daemon.py
-rwxr-xr-x root root Aug end2endTest.py
-rw-r--r-- root root Aug hadoop-metrics2-hbase.properties
-rw-r--r-- root root Aug hadoop-metrics2-phoenix.properties
-rw-r--r-- root root Aug hbase-site.xml
-rw-r--r-- root root Aug log4j.properties
-rwxr-xr-x root root Aug performance.py
-rwxr-xr-x root root Aug pherf-cluster.py
-rwxr-xr-x root root Aug pherf-standalone.py
-rwxr-xr-x root root Aug phoenix_utils.py
-rw-r--r-- root root Apr : phoenix_utils.pyc
-rwxr-xr-x root root Aug psql.py
-rwxr-xr-x root root Aug queryserver.py
-rw-r--r-- root root Aug readme.txt
-rwxr-xr-x root root Aug sqlline.py
-rwxr-xr-x root root Aug sqlline-thin.py
-rw-r--r-- root root Aug tephra
-rwxr-xr-x root root Aug tephra-env.sh
-rwxr-xr-x root root Aug traceserver.py
[root@cmbigdata1 bin]# ./sqlline.py slave1:
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:slave1: none none org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:slave1:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/soft/phoenix/phoenix-4.8.-cdh5.8.0/phoenix-4.8.-cdh5.8.0-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/soft/bigdata/clouderamanager/cloudera/parcels/CDH-5.10.-.cdh5.10.0.p0./jars/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
// :: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Connected to: Phoenix (version 4.8)
Driver: PhoenixEmbeddedDriver (version 4.8)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true to skip)...
/ (%) Done
Done
sqlline version 1.1.
0: jdbc:phoenix:cmbigdata1:2181>
8、简单测试
扩展
Apache版Phoenix的安装(图文详解)
同时,大家可以关注我的个人博客:
http://www.cnblogs.com/zlslch/ 和 http://www.cnblogs.com/lchzls/
人生苦短,我愿分享。本公众号将秉持活到老学到老学习无休止的交流分享开源精神,汇聚于互联网和个人学习工作的精华干货知识,一切来于互联网,反馈回互联网。
目前研究领域:大数据、机器学习、深度学习、人工智能、数据挖掘、数据分析。 语言涉及:Java、Scala、Python、Shell、Linux等 。同时还涉及平常所使用的手机、电脑和互联网上的使用技巧、问题和实用软件。 只要你一直关注和呆在群里,每天必须有收获
以及对应本平台的QQ群:161156071(大数据躺过的坑)