Skip to content

Commit

Permalink
something in my drink
Browse files Browse the repository at this point in the history
  • Loading branch information
xianglei committed Aug 8, 2012
1 parent 92e80f6 commit fd03ba8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
28 changes: 5 additions & 23 deletions config.inc.php
@@ -1,13 +1,8 @@
<?php <?php
session_id(); session_id();
session_start(); session_start();
$GLOBALS['THRIFT_ROOT'] = './libs/';

require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.auth.php';
require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.etc.php';
require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.etl.php';
require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.hive.php';


include "static.inc.php";
#comment below if you didn't wanna use authenticate #comment below if you didn't wanna use authenticate
$auth = new Authorize; $auth = new Authorize;


Expand Down Expand Up @@ -72,12 +67,6 @@
#comment up if you didn't wanna use authenticate #comment up if you didn't wanna use authenticate
#如果不需要验证,请注释掉以上部分 #如果不需要验证,请注释掉以上部分


# 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';
require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.timer.php';



#-----------defination of HIVE Server and port----- #-----------defination of HIVE Server and port-----
#-----------定义Hive Server连接地址与端口---------- #-----------定义Hive Server连接地址与端口----------
Expand All @@ -100,20 +89,13 @@
define('METAPASS', 'hive'); define('METAPASS', 'hive');
define('METANAME', 'hive'); define('METANAME', 'hive');


#----------------
#define('METATYPE', 'pgsql');
#define('METADB','192.168.1.28');
#define('METAPORT', '5432');
#define('METAUSER', 'hive');
#define('METAPASS', 'hive');
#define('METANAME', 'hive');
#------------------------------------------------------------------ #------------------------------------------------------------------
$env['hive_jar'] = '/opt/modules/hive/hive-0.7.1/lib/hive-contrib-0.7.1.jar'; $env['hive_jar'] = '';
#------------------server env important: you must hive a executable hive-cli on this machine---------------------- #------------------server env important: you must hive a executable hive-cli on this machine----------------------
#------------------定义环境变量 重要:你必须在本机有一个可执行的hive命令行程序-------------------- #------------------定义环境变量 重要:你必须在本机有一个可执行的hive命令行程序--------------------
$env['hadoop_home'] = '/opt/modules/hadoop/hadoop-0.20.203.0';# hadoop root path $env['hadoop_home'] = '';# hadoop root path
$env['hive_home'] = '/opt/modules/hive/hive-0.7.1';# hive root path $env['hive_home'] = '';# hive root path
$env['java_home'] = '/usr/java/jdk1.6.0_21';# jdk root path $env['java_home'] = '';# jdk root path
$env['lang_set'] = 'zh_CN.UTF-8';#system language set $env['lang_set'] = 'zh_CN.UTF-8';#system language set
$env['udf'] = '';#user defined function load command. it should be a jar, if not have an udf , set it to "" $env['udf'] = '';#user defined function load command. it should be a jar, if not have an udf , set it to ""
#$env['lang_set'] = 'en_US.UTF-8'; #$env['lang_set'] = 'en_US.UTF-8';
Expand Down
1 change: 1 addition & 0 deletions getQueryPlan.php
Expand Up @@ -24,6 +24,7 @@
{ {
$echo .= str_replace(" ","&nbsp;",$v)."<br />"; $echo .= str_replace(" ","&nbsp;",$v)."<br />";
} }
echo "<font color=red>HQL Syntax OK!!!<br><br></font>";
echo $echo; echo $echo;
} }
catch (Exception $e) catch (Exception $e)
Expand Down
14 changes: 14 additions & 0 deletions install.sh
@@ -0,0 +1,14 @@
#!/bin/sh
chmod 777 results etl logs
echo "Set phpHiveAdmin runtime enviroment"
read -p "Please input Hadoop Home path: " HADOOPHOME
read -p "Please input Hive Home path: " HIVEHOME
read -p "Please input Java Home Path: " JAVAHOME

echo $HADOOPHOME
echo $HIVEHOME
echo $JAVAHOME

sed -i -e "/^\$env\['hadoop_home'\]/{ s@'';@'$HADOOPHOME';@; }" config.inc.php
sed -i -e "/^\$env\['hive_home'\]/{ s@'';@'$HIVEHOME';@; }" config.inc.php
sed -i -e "/^\$env\['java_home'\]/{ s@'';@'$JAVAHOME';@; }" config.inc.php
13 changes: 13 additions & 0 deletions static.inc.php
@@ -0,0 +1,13 @@
<?php
$GLOBALS['THRIFT_ROOT'] = './libs/';

require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.auth.php';
require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.etc.php';
require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.etl.php';
require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.hive.php';

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';
require_once $GLOBALS['THRIFT_ROOT'] . 'classes/class.timer.php';
?>

0 comments on commit fd03ba8

Please sign in to comment.