Cloudera Labs
Provide feedback on Cloudera Labs
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

phoenix-sqlline.py not working

phoenix-sqlline.py not working

New Contributor

~]# /usr/bin/phoenix-sqlline.py ZK_hostname:2181
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:ZK_hostname:2181 none none org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:ZK_hostname:2181
16/01/17 22:13:15 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/01/17 22:13:15 WARN impl.MetricsConfig: Cannot locate configuration: tried hadoop-metrics2-phoenix.properties,hadoop-metrics2.properties

2 REPLIES 2

Re: phoenix-sqlline.py not working

New Contributor

 

It only works when executing the pheonix shell from the directory /etc/hbase/conf

 

cd /etc/hbase/conf
conf]# /usr/bin/phoenix-sqlline.py ZK_hostname:2181
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect jdbc:phoenix:ZK_hostname:2181 none none org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:ZK_hostname:2181
16/01/17 22:17:34 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/01/17 22:17:34 WARN impl.MetricsConfig: Cannot locate configuration: tried hadoop-metrics2-phoenix.properties,hadoop-metrics2.properties
Connected to: Phoenix (version 4.5)
Driver: PhoenixEmbeddedDriver (version 4.5)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true to skip)...
87/87 (100%) Done
Done
sqlline version 1.1.8
0: jdbc:phoenix:ZK_hostname:2181>

Re: phoenix-sqlline.py not working

New Contributor

Your first run didn't worked because when you run phoenix-sqlline.py outside of Hbase conf folder it is expecting HBASE_CONF_DIR from your OS environment variable setting.

 

If it doesn't find HBASE_CONF_DIR variable set/configured in your OS environment, it will refer current directory as Hbase conf directory which is obviously not Hbase conf directory.

 

And thats why your second-run ran successfully when you tried to execute script from Hbase conf directory.

 

Do let me know if you still have any doubt.

 

Thanks,

Chirag Patadia.