简体   繁体   English

与HBase建立Happybase连接时出错,如何定义主机

[英]Error while Happybase connection with hbase, how I define my host

I want to connect Pyspark with Hbase by Happybase. 我想通过Happybase将Pyspark与Hbase连接起来。 But I get this error at the beginnig: 但我在beginnig时收到此错误:

(pyenv) hduser@master:~$ python -c 'import happybase' (pyenv)hduser @ master:〜$ python -c'导入happybase'
(pyenv) hduser@master:~$ python -c connection = happybase.Connection("somehost") bash: syntax error near unexpected token `(' (pyenv)hduser @ master:〜$ python -c connection = happybase.Connection(“ somehost”)bash:意外令牌'('附近的语法错误

First there is a syntax error in connection command. 首先,连接命令中存在语法错误。 Secondly if you want to use the happybase library in subsequent steps, you have to run the entire script into single command from the bash in following way so that the session will be maintained. 其次,如果要在后续步骤中使用happybase库,则必须按照以下方式从bash将整个脚本运行到单个命令中,以便维护会话。

 python -c "import happybase;connection = happybase.Connection('localhost')"

Another option is create a python .py file and run that from the bash. 另一个选择是创建一个python .py文件,然后从bash运行该文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用PySpark写入HBase表时出错 - Error while writing to HBase Table using PySpark 使用HappyBase连接池的PySpark dataframe.foreach()返回'TypeError:无法pickle thread.lock对象' - PySpark dataframe.foreach() with HappyBase connection pool returns 'TypeError: can't pickle thread.lock objects' 使用pyspark写入Cassandra时出现连接错误 - Connection error while writing into Cassandra using pyspark 如何使用pyspark和shc(spark hbase连接器)而不是整个数据集从hbase读取一张表的部分数据? - How can I read one tables partial data from hbase with pyspark and shc(spark hbase connector) instead of whole dataset? HBase和Spark-尝试写入表时出现NullPointerException - HBase and Spark - NullPointerException while trying to write to table 如何将 Pyspark 数据帧存储到 HBase 中 - how to store Pyspark dataframe into HBase 使用 SQlcontext 在 spark 中加载我的 csv 时出错 - I am getting error while loading my csv in spark using SQlcontext 如何从pyspark连接到hbase - How to connect from pyspark to hbase 关闭终端时,如何在服务器上使用python运行dse spark应用程序? - How can I run my dse spark app with python on a server while closing my terminal? ConnectException: Connection refused (Connection refused) Error while obtaining a new communication channel。 数据块笔记本中的错误 - ConnectException: Connection refused (Connection refused) Error while obtaining a new communication channel. error in databricks notebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM