欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

hbase单机版安装+phoneix SQL on hbase 单节点安装

程序员文章站 2023-11-03 18:49:58
hbase 单机安装部署及phoneix 单机安装 Hbase 下载 (需先配置jdk) 解压安装 修改配置文件 配置文件修改 启动 hbase 修改环境变量 环境变量配置 安装测试 安装phoneix 下载 解压到目录 将 修改 hosts文件(必须配置) 重启habse 启动phoneix 可能 ......

hbase 单机安装部署及phoneix 单机安装

hbase 下载 (需先配置jdk)

 https://www.apache.org/dyn/closer.lua/hbase/2.0.1/hbase-2.0.1-bin.tar.gz

解压安装

tar -xzvf hbase-2.0.01-bin.tar.gz
mv hbase-2.0.0.1-ibin hbase
mv hbase-2.0.0.1 hbase
mv hbase /opt

修改配置文件

cd /opt/hbase/conf/
vi hbase-site.xml

配置文件修改

<configuration>

  <property>
    <name>hbase.rootdir</name>
    <value>file:////数据存放路径</value>
  </property>
  <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>


</configuration>

启动 hbase

cd /opt/hbase
/bin/start-hbase.sh

修改环境变量

cd ~
vi /etc/profile

环境变量配置

export hbase_home=/opt/hbase

export path=$path:$hbase_home/bin

安装测试

hbase shell


list

安装phoneix

下载

http://www.apache.org/dyn/closer.lua/phoenix/apache-phoenix-5.0.0-hbase-2.0/bin/apache-phoenix-5.0.0-hbase-2.0-bin.tar.gz

解压到目录

cp   phoenix-*-server.jar  /opt/hbase/lib
cp   phoenix-core*.jar /opt/hbase/lib 

修改 hosts文件(必须配置)

127.0.0.1 localhost

重启habse

启动phoneix

./sqlline.py localhost:2181

可能报错,如果报错将所有的jar 包复制到habse/lib下; 因为启动hbase时会创建四张表(会有缺包现象)

重新启动

0: jdbc:phoenix:localhost:2181> !tables

+------------+--------------+-------------+---------------+----------+------------+----------------------------+-------------+

| table_cat  |table_schem  |table_name  |  table_type   |remarks  |type_name  |self_referencing_col_name  |ref_generat |

+------------+--------------+-------------+---------------+----------+------------+----------------------------+-------------+

|            |system       |catalog     |system table  |          |            |                            |            |

|            |system       |function    |system table  |          |            |                            |            |

|            |system       |sequence    |system table  |          |            |                            |            |

|            |system       |stats       |system table  |          |            |                            |            |

+------------+--------------+-------------+---------------+----------+------------+----------------------------+-------------+

启动成功,到此结束!!!欢迎学习!!