安装Phoenix时,执行./splline.py报错File “./sqlline.py“, line 25, in <module> import phoenix_utils File,如下图所示:
(base) [root@node1 bin]# ./sqlline.py node1:2181 Traceback (most recent call last): File "./sqlline.py", line 25, inimport phoenix_utils File "/export/server/apache-phoenix-5.0.0-HBase-2.0-bin/bin/phoenix_utils.py", line 208 print "phoenix_class_path:", phoenix_class_path ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("phoenix_class_path:", phoenix_class_path)?
解决方法:
可以使用:/usr/bin/python2 ./sqlline.py node1:2181 来启动Phoenix服务。
Setting property: [incremental, false] Setting property: [isolation, TRANSACTION_READ_COMMITTED] issuing: !connect jdbc:phoenix:node1:2181 none none org.apache.phoenix.jdbc.PhoenixDriver Connecting to jdbc:phoenix:node1:2181 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/export/server/apache-phoenix-5.0.0-HBase-2.0-bin/phoenix-5.0.0-HBase-2.0-client.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 22/06/06 22:37:28 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Connected to: Phoenix (version 5.0) Driver: PhoenixEmbeddedDriver (version 5.0) Autocommit status: true Transaction isolation: TRANSACTION_READ_COMMITTED Building list of tables and columns for tab-completion (set fastconnect to true to skip)... 133/133 (100%) Done Done sqlline version 1.2.0
报这种错误的原因是因为我们现在用的python3的版本,而Phoenix需要python2来启动,直接运行有可能运行了python3。



