时间:2021-07-01 10:21:17 帮助过:32人阅读
yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel
# ./configure --without-ruby # make && make install
# ./hive --service hiveserver >/dev/null 2>/dev/null &
netstat -tnlp|grep :10000
// php连接hive thrift依赖包路径 $GLOBALS['THRIFT_ROOT'] = '/var/www/html/hivephp/thrift/'; // load the required files for connecting to Hive require_once $GLOBALS['THRIFT_ROOT'] . 'packages/hive_service/ThriftHive.php'; require_once $GLOBALS['THRIFT_ROOT'] . 'transport/TSocket.php'; require_once $GLOBALS['THRIFT_ROOT'] . 'protocol/TBinaryProtocol.php'; // Set up the transport/protocol/client $transport = new TSocket('localhost', 10000); $protocol = new TBinaryProtocol($transport); $client = new ThriftHiveClient($protocol); $transport->open(); // run queries, metadata calls etc $client->execute('add jar /usr/local/hadoop/hive/lib/hive-contrib-0.7.0-cdh3u0.jar'); $client->execute('select count(1) from apilog'); var_dump($client->fetchAll()); $transport->close(); ?>