-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not connect to hiveserver2 #22
Comments
may be is hiveserver2 close it self. after I restart hiveserver2, I got error bellow : |
问题解决了。算是hive配置的问题吧。有人说 PHP的框架不支持SASL,或者我不会用。 参考答案: |
$hive = new \ThriftSQL\Hive('stats-hadoop11', 10000, 'yeyifeng','fake_password');
$hive->setSasl(true);
var_dump($hive->connect()->queryAndFetchAll('show tables;')) ; Works for me.Just using a fake pasword. But my hive server does not have this configure. |
I was trying to connect with Username Authentication for my Hiveserver2. I was getting an error for "tsocket read 0 bytes". Creating a fake username and password worked for me. |
I can connect to hiveserver2 in beeline whith beeline> !connect jdbc:hive2://192.168.1.110:10010
but cannot conncet to hiveserver2 whith code blow (there are no username and password):
$hive = new \ThriftSQL\Hive( '192.168.1.110',10010); $hiveTables = $hive ->setSasl( false ) /* To turn SASL auth off, on by default */ ->connect() ->queryAndFetchAll( 'SHOW TABLES' ); print_r( $hiveTables );
and I got the error :
PHP Fatal error: Uncaught Thrift\Exception\TException: TSocket: Could not connect to 192.168.1.110:10010 (Connection refused [111]) in phar:///home/lixiyu/code/php-thrift-sql/ThriftSQL.phar/Thrift/Transport/TSocket.php:235 Stack trace: #0 phar:///home/lixiyu/code/php-thrift-sql/ThriftSQL.phar/ThriftSQL/Hive.php(47): Thrift\Transport\TSocket->open() #1 /home/lixiyu/code/php-thrift-sql/example.php(10): ThriftSQL\Hive->connect() #2 {main} thrown in phar:///home/lixiyu/code/php-thrift-sql/ThriftSQL.phar/Thrift/Transport/TSocket.php on line 235
can somebody help me ?
The text was updated successfully, but these errors were encountered: