我需要使用Hadoop中的数据在PHP应用程序中创建一个报告。我已经在本地计算机上安装了hiveserver2。我尝试使用以下示例找到从我的PHP代码连接到hiveserver2的方法。
但是他们中的任何一个都不适合我。我已经按照下面第一个链接中所述更改了hive-site.xml的配置。
<property>
<name>hive.server2.authentication</name>
<value>NOSASL</value>
<description>
Expects one of [nosasl, none, ldap, kerberos, pam, custom]
在第一个链接中运行PHP文件时,出现以下错误。
Uncaught exception 'Thrift\Exception\TTransportException' with message 'TSocket: timed out reading 4 bytes from localhost:10000' in /Users/lazhcm10385/projects/hive/hive-hs2-php-thrift/thrift/Thrift/Transport/TSocket.php:274
如果有人拥有适当的文档以使用PHP连接到hiveserver2,请帮助我。
最佳答案
我可以使用https://github.com/QwertyManiac/hive-hs2-php-thrift从php连接到hive服务器。更改配置单元服务器的配置后,我关闭了终端并再次打开,然后使用新打开的终端启动了服务器。
关于php - 使用PHP连接到hiveserver2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37047058/