1

我无法通过 hive 连接到 PHP 中的 cosmos 服务器:

 // Load this lib
  require_once __DIR__ . '/php-thrift-sql-master/ThriftSQL.phar';

  // Try out a Hive query

$usuario="user@user";
$clave="pass"; 

  $hive = new \ThriftSQL\Hive( 'cosmos.lab.fiware.org', 10000, $usuario, $clave, 1);
  $hiveTables = $hive
    ->setSasl( false ) // To turn SASL auth off, on by default
    ->connect()
    ->queryAndFetchAll( 'SHOW TABLES' );
  print_r( $hiveTables );

  // Don't forget to clear the client and close socket.
  $hive->disconnect();

Error produced is Thrift\Exception\TTransportException: TSocket: timed out reading 4 bytes from cosmos.lab.fiware.org:10000 in phar://C:/Users/.../php-thrift-sql-master/ThriftSQL.phar/Thrift/Transport/TSocket.php on line 274

我尝试使用其他服务器,如 storage.cosmos.lab.fiware.org 和 Computing.cosmos.lab.fiware.org。如果我设置了很长的超时时间,那么脚本将永远等待。

你能帮我用php连接到cosmos的hive服务器吗?

4

1 回答 1

0

问题出在你的端口..写端口你在哪里使用hadoop。我的是8088。

于 2017-01-12T13:00:08.570 回答