2016-05-05 103 views
0

我需要在我的PHP應用程序中使用Hadoop中的數據創建報告。我在本地機器上安裝了hiveserver2。我嘗試使用以下示例從我的PHP代碼中找到連接到hiveserver2的方法。使用PHP連接到hiveserver2

  1. https://github.com/QwertyManiac/hive-hs2-php-thrift
  2. https://github.com/dryangkun/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。

回答