简体   繁体   中英

Can't run a python script

I am trying to run the performance.py script that comes with the Phoenix Apache open source project.

Per instructions (I am new to python), I execute:

performance.py localhost 999

I get this error:

Phoenix Performance Evaluation Script 1.0
-----------------------------------------

Creating performance table...
Error: Could not find or load main class org.apache.phoenix.util.PhoenixRuntime
Query # 1 - Count - SELECT COUNT(1) FROM PERFORMANCE_999;
Query # 2 - Group By First PK - SELECT HOST FROM PERFORMANCE_999 GROUP BY HOST;
Query # 3 - Group By Second PK - SELECT DOMAIN FROM PERFORMANCE_999 GROUP BY DOM
AIN;
Query # 4 - Truncate + Group By - SELECT TRUNC(DATE,'DAY') DAY FROM PERFORMANCE_
999 GROUP BY TRUNC(DATE,'DAY');
Query # 5 - Filter + Count - SELECT COUNT(1) FROM PERFORMANCE_999 WHERE CORE<10;


Generating and upserting data...
Error: Unable to access jarfile 999


Error: Could not find or load main class org.apache.phoenix.util.PhoenixRuntime

So not sure whats going on here. Error Error: Unable to access jarfile 999 suggests that I not passing in values correctly. However, I am following the instructions in that script.

What am I missing?
PS This is happening on Windows Server 2012

That script is using this line:

subprocess.call("java -jar %s %s" % (phoenix_utils.testjar, rowcount), shell=True)

And from your output, the phoenix_utils.testjar is obviously blank. Are you sure you have the Java environment setup correctly?

Even higher in your log, it says:

Error: Could not find or load main class org.apache.phoenix.util.PhoenixRuntime

I also met the same issue. Digging into the script, it is due to the phoenix-core-xxx-tests.jar in an incorrect directory, so the script cannot find it.

looking at phoenix_utils.py, it is pointing the test jar to phoenix_root_directory. But the jar is actually locating on phoenix_root_directory/lib.

copy the jar to the root directory and cd to the phoenix_root_directory/bin and run the performance.py.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM