安装Phoenix时./sqlline.py执行报错File "./sqlline.py", line 27, in <module> import argparse ImportError: No module named argparse解决办法(图文详解)
不多说,直接上干货!
前期博客
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解决办法(图文详解)的更多相关文章
- 安装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/ ...
- 编译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 ...
- 使用二进制方式安装K8S时使用kubectl命令报错:The connection to the server localhost:8080 was refused - did you specify the right host or port?
解决思路: kubectl 默认从 ~/.kube/config 配置文件获取访问 kube-apiserver 地址.证书.用户名等信息,如果没有配置该文件,或者该文件个别参数配置出错,执行命令时出 ...
- 安装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 ...
- 安装vue时使用npm install 报错
npm ERR! Darwin 14.3.0 npm ERR! argv "/usr/local/Cellar/node/6.4.0/bin/node" "/usr/lo ...
- npm 安装扩展模块时,因缓存报错的问题汇总
1.缓存报错问题一 : unexpected end of file 解决方法:运行:npm cache verify 清除缓存 2.缓存报错问题二 : errno -4048(网上一般说 ...
- svn报错cleanup failed–previous operation has not finished; run cleanup if it was interrupted的解决办法
今天在svn提交的时候它卡顿了一下,我以为已经提交完了,就按了一下,结果就再也恢复不了,也继续不了了... 报错 cleanup failed–previous operation has not f ...
- 类中调用界面ActiveX控件报错当前线程不在单线程单元中因此无法实例化 ActiveX 控件的解决办法
解决办法是Form类中定义一个静态的ActiveX对象,在formload中将界面上的ActiveX对象赋值给新定义的对象,类中访问该静态对象即可. public static AxClientDri ...
- 安装php时,make test报错
Build complete. Don't forget to run 'make test'. [root@localhost php-5.4.5]# make test ERROR: Cannot ...
随机推荐
- java jvm perf
http://www.oracle.com/technetwork/java/performance-138178.html http://www.oracle.com/technetwork/jav ...
- nginx检查报错 error while loading shared libraries: libprofiler.so.0: cannot open shared object file: No such file or directory
在centos7.3上编译安装nginx-1.12.2 启动测试出错 [root@web02 local]# /usr/local/nginx/sbin/nginx -t /usr/local/ngi ...
- 将ASCII字符串转换为UNICODE字符串
写在前面的话:在MFC的网络编程中,由于现在项目都是使用UNICODE编码,但是网络API的许多函数却只能接受const char*的参数,所以经常会遇到需要将char*转换为TCHAR*的时候,有一 ...
- 检测SqlServer数据库是否能连接的小技巧
有时候可能需要检测下某台机器的服务是不是起来了,或者某台机器的某个库是不是能被连接又不能打开ssms也不想登陆服务器的话就可以用这个方法. 1.在桌面上右键创建个文本,然后改后缀名为udl以后保存(1 ...
- ubuntu16.04中文乱码解决方案
把环境变量设置为中文 </pre><pre name="code" class="plain">sudo vi /etc/default ...
- C++ - 动态申请数组空间
// 用指针p指向由new动态分配的长度为length*sizeof(int)的内存空间. int * p = new int[length];
- Apache HttpComponents POST提交带参数提交
public class Test { public static void main(String[] args) throws IOException { DefaultHttpClient ht ...
- linux内存查看及释放
查看内存 常用的查看内存工具有:top,ps,free,/proc/meminfo,/proc/$PID/status等,一般都指定了虚拟内存占用情况,但ps或/proc/$PID/status中RS ...
- javascript总述
一.JavaScript核心 一个完整的JavaScript应该由下列三个不同的部分组成. 1.核心(ECMAScript) 2.文档对象模型(DOM,Document Object Model) 3 ...
- Entity Framework应用:Code First模式数据迁移的基本用法
使用Entity Framework的Code First模式在进行数据迁移的时候会遇到一些问题,熟记一些常用的命令很重要,下面整理出了数据迁移时常用的一些命令. 一.模型设计 EF默认使用id字段作 ...