1. Download phoenix-4.0.0-incubating.tar.gz
1
|
wget http://mirror.bit.edu.cn/apache/incubator/phoenix/phoenix-4.0.0-incubating/bin/phoenix-4.0.0-incubating.tar.gz
|
2. Unzip the phoenix-4.0.0-incubating.tar.gz to the/OPT directory
1
|
Tar zxvf phoenix-4.0.0-incubating.tar.gz-c/opt
|
3. Add Phoenix-core-4.0.0-incubating.jar to all HBase region servers in classpath (copy it into the HBase lib directory)
Add the Phoenix-core-[version]-incubating.jar to the classpath of every HBase region server. An easy-to-do-is-to-copy it into the HBase Lib directory.
1
|
/opt/phoenix-4.0.0/common/phoenix-core-4.0.0-incubating.jar
|
4. Restart the HBase cluster
5. Add the Phoenix-[version]-incubating-client.jar to the classpath of any Phoenix client (both Hadoop-1 or Hadoop-2 Compatible client jars is available in latest release).
1
2
3
4
|
Export java_home=/opt/jdk1.7.0_51
export class_path=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JAVA _ Home/jre/lib/rt.jar
export phoenix_home=/opt/phoenix-4.0.0
export class_path= $CLASS _path: $PHOENIX _home/ Hadoop-2/phoenix-4.0.0-incubating-client.jar
|
Note: There is no need to set Phoenix-4.0.0-incubating-client.jar to Classpath on each machine (HBase region server), usually in HBase master settings. 6. Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 All-in-a- |
0:jdbc:phoenix:master:2181>!help!all Execute The specified SQL against all the current connections!a Utocommit Set autocommit mode on or off!batch Start or execute a batch of statements!brief Set verbose mode off!call Execute A callable statement!close close the current connectio N to the database!closeall Close all current open connections!columns List all the columns for the Specified table!commit commit the current transaction (if Autocommit is off)!connect Open a new C
Onnection to the database. !dbinfo Give metadata information about the database!describe describe a table!dropall Drop all tables on the current database!exportedkeys List all the exported keys for the specified table!go Select The current connection!help Print a summary of command usage!history Display The command history!importedkeys list all the imported keys for the specified table!indexes list all T He |