不多说,直接上干货!

  前期博客

Apache版Phoenix的安装(图文详解)

  问题现象

Traceback (most recent call last):
File "./sqlline.py", line , in <module>
import argparse
ImportError: No module named argparse

  解决办法

[root@master phoenix]# yum install python-argparse
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors..com
* extras: mirrors..com
* updates: mirrors..com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package python-argparse.noarch :1.2.-2.1.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved ===============================================================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================================================
Installing:
python-argparse noarch 1.2.-2.1.el6 base k Transaction Summary
===============================================================================================================================================================================================
Install Package(s) Total download size: k
Installed size: k
Is this ok [y/N]: y
Downloading Packages:
python-argparse-1.2.-2.1.el6.noarch.rpm | kB :
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : python-argparse-1.2.-2.1.el6.noarch /
Verifying : python-argparse-1.2.-2.1.el6.noarch / Installed:
python-argparse.noarch :1.2.-2.1.el6 Complete!
[root@master phoenix]#

  然后,再重启HBase集群。

[hadoop@master apache-phoenix-4.8.-HBase-0.98-bin]$ bin/sqlline.py master
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:master none none org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:master
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/app/apache-phoenix-4.8.-HBase-0.98-bin/phoenix-4.8.-HBase-0.98-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/app/hadoop-2.6./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
// :: 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.
: jdbc:phoenix:master>

  退出

Building list of tables and columns for tab-completion (set fastconnect to true to skip)...
/ (%) Done
Done
sqlline version 1.1.
: jdbc:phoenix:master,slave1,slave2:> !exit
Closing: org.apache.phoenix.jdbc.PhoenixConnection
[hadoop@master phoenix]$

  这里,建议搭建,你若如跟我一样(master、slave1和slave2)集群的话,zookeeper也是都安装在master、slave1和slave2上,则

  使用 sqlline.py 脚本来启动,参数是 zookeeper 集群中各个节点的 hostname ,多个使用逗号隔开,另外端口为 2181

[hadoop@master apache-phoenix-4.8.-HBase-0.98-bin]$ pwd
/home/hadoop/app/apache-phoenix-4.8.-HBase-0.98-bin
[hadoop@master apache-phoenix-4.8.-HBase-0.98-bin]$ bin/sqlline.py master,slave1,slave2:
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:master,slave1,slave2: none none org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:master,slave1,slave2:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/app/apache-phoenix-4.8.-HBase-0.98-bin/phoenix-4.8.-HBase-0.98-client.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/app/hadoop-2.6./share/hadoop/common/lib/slf4j-log4j12-1.7..jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
// :: 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.
: jdbc:phoenix:master,slave1,slave2:>

  成功!

安装Phoenix时./sqlline.py执行报错File "./sqlline.py", line 27, in <module> import argparse ImportError: No module named argparse解决办法(图文详解)的更多相关文章

  1. 安装php时,make步骤报错make: *** [ext/gd/gd.lo] Error 1

    安装PHP时,make步骤报错make: *** [ext/gd/gd.lo] Error 1 /usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/ ...

  2. 编译Twitter的Heron时一直报错“heron/bazel_configure.py", line 25, in <module> import semver ImportError: No module named semver”如何处理。

    今天编译heron的时候,从官方git到的源码bazel_configure的时候一直报错如下: Traceback (most recent call last): File , in <mo ...

  3. 使用二进制方式安装K8S时使用kubectl命令报错:The connection to the server localhost:8080 was refused - did you specify the right host or port?

    解决思路: kubectl 默认从 ~/.kube/config 配置文件获取访问 kube-apiserver 地址.证书.用户名等信息,如果没有配置该文件,或者该文件个别参数配置出错,执行命令时出 ...

  4. 安装php时,make步骤报错make: *** [sapi/fpm/php-fpm] Error 1

    安装PHP过程中,make步骤报错:(集中网络上各种解决方法) (1)-liconv -o sapi/fpm/php-fpm /usr/bin/ld: cannot find -liconv coll ...

  5. 安装vue时使用npm install 报错

    npm ERR! Darwin 14.3.0 npm ERR! argv "/usr/local/Cellar/node/6.4.0/bin/node" "/usr/lo ...

  6. npm 安装扩展模块时,因缓存报错的问题汇总

    1.缓存报错问题一 :    unexpected end of file 解决方法:运行:npm cache verify  清除缓存 2.缓存报错问题二 :   errno -4048(网上一般说 ...

  7. svn报错cleanup failed–previous operation has not finished; run cleanup if it was interrupted的解决办法

    今天在svn提交的时候它卡顿了一下,我以为已经提交完了,就按了一下,结果就再也恢复不了,也继续不了了... 报错 cleanup failed–previous operation has not f ...

  8. 类中调用界面ActiveX控件报错当前线程不在单线程单元中因此无法实例化 ActiveX 控件的解决办法

    解决办法是Form类中定义一个静态的ActiveX对象,在formload中将界面上的ActiveX对象赋值给新定义的对象,类中访问该静态对象即可. public static AxClientDri ...

  9. 安装php时,make test报错

    Build complete. Don't forget to run 'make test'. [root@localhost php-5.4.5]# make test ERROR: Cannot ...

随机推荐

  1. Angular External js library calling Document.Ready

    https://stackoverflow.com/questions/51094841/angular-external-js-library-calling-document-ready Step ...

  2. Windows mobile 下读取手机SIM卡信息(转)

    Windows mobile 下读取手机SIM卡信息 c#改善 Windows mobile 下读取手机SIM卡信息

  3. xslt循环转换子元素

    转换源xml <keywords class="array"> <e type="string">e1</e> <e ...

  4. Cannon

    Description In Chinese Chess, there is one kind of powerful chessmen called Cannon. It can move hori ...

  5. C陷阱与缺陷的学习笔记

    1用单引号括起的字符实际代表一个整数,整数值对应于该字符在编译器中采用的字符集对应的序列值:双引号括起的字符串,代表的是一个指向无名数组起始字符的指针,该数组被双引号之间的字符和‘\0’初始化.对于' ...

  6. 【翻译自mos中文文章】重建控制文件的方法

    重建控制文件的方法 參考原文: How to Recreate a Controlfile (Doc ID 735106.1) 适用于: Oracle Database - Enterprise Ed ...

  7. vm虚拟化问题积累

    EXSi是什么?答:是一个独立的系统,承载了虚拟机管理台,虚拟机存储设备等核心要件的一个系统,需要靠客户机通过vsphere连接后进行管理. 问题集:一.建立桌面池找不到模板机问题: 目前因为此问题已 ...

  8. 一站式学习Wireshark(三):应用Wireshark IO图形工具分析数据流

    基本IO Graphs: IO graphs是一个非常好用的工具.基本的Wireshark IO graph会显示抓包文件中的整体流量情况,通常是以每秒为单位(报文数或字节数).默认X轴时间间隔是1秒 ...

  9. libmysqlclient16 libmysqlclient-dev

    如果提示安装 libmysqlclient16 则用 libmysqlclient-dev 代替之

  10. js类型转换 之 转字符串及布尔类型

    上一篇我们讲到了如何转数字类型,今天总结一下转字符串及布尔类型的方法: 转字符串方法主要有: toString(); String(); 具体的用法如下表格所示: 方法 例子 返回值 说明 toStr ...