不多说,直接上干货!

  前期博客

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. MySQL - 1093异常 - You can't specify target table 't' for update in FROM clause

    有一个表示地区的表,表结构与数据大概如下表. ID NAME PARENT_ID 1 中国 2 广东省 1 3 广州市 2 4 荔湾区 3 5 越秀区 3 6 番禺区 3 7 小谷围街道 6 现为了查 ...

  2. Spark大师之路:广播变量(Broadcast)源码分析

    概述 最近工作上忙死了……广播变量这一块其实早就看过了,一直没有贴出来. 本文基于Spark 1.0源码分析,主要探讨广播变量的初始化.创建.读取以及清除. 类关系 BroadcastManager类 ...

  3. 使用SimpleMDE富文本编辑器

    1). 安装 SimpleMDE npm install simplemde --save 2). 使用 SimpleMDE 1.打开 src/views/articles/Create.vue 文件 ...

  4. 一款仿ios7的switches开关按钮

    今天给大家介绍一款仿ios7的switches开关按钮.这款按钮也是纯css实现的.无需引js代码.在实现中给出了两种颜色,三种不同大小的demo.一起看下效果图: 在线预览   源码下载 实现的代码 ...

  5. 章鱼哥出品—VB.NET DataGridView绑定数据源 &quot;与货币管理器的位置关联的行不能设置为不可见&quot; 问题的解决

    DtaGridView绑定数据源后.假设想让数据条件显示的话,直接使用  My_Row.Visible = False就会出错.错误类型是 "与货币管理器的位置关联的行不能设置为不可见&qu ...

  6. Unity3d中使用摄像机制作实时显示小地图

    Unity3d中使用摄像机制作实时显示小地图,以之前的tank为例.开始制作之前场景中物体如图. 开始制作,步骤1:新建一个camera及一个plane.对齐位置,将camera改名为camera_U ...

  7. Maven学习:项目之间的关系

    Maven不仅可以定义一个项目中各个模块之间的关系,还可以更延伸一步定义项目与项目之间的关系. 定义父子项目的好处还是挺多的.

  8. Java面向对象编程:封装,继承,多态

    Java面向对象的三大特征: 封装:通过Java的类来实现数据和操作方法的封装,对外界可以将每一个Java类都视为一个黑箱,只需调用该黑箱提供的方法即可完成你想要的操作. 继承:通过类的继承,将统一的 ...

  9. 官网下载到离线的Adobe Acrobat Reader DC

    Adobe 官方 FTP :ftp://ftp.adobe.com/ Adobe Acrobat Reader DC 下载目录:ftp://ftp.adobe.com/pub/adobe/reader ...

  10. HTTP API 设计指南(请求部分)

    为了保证持续和及时的更新,强烈推荐在我的Github上关注该项目,欢迎各位star/fork或者帮助翻译 前言 这篇指南介绍描述了 HTTP+JSON API 的一种设计模式,最初摘录整理自 Hero ...