0

使用此 python 脚本通过 Hive 查询 COSMOS:

import pyhs2

with pyhs2.connect(host='cosmos.lab.fiware.org',
                    port=10000,
                    authMechanism="PLAIN",
                    user='glaquidara',
                    password='*****',
                    database='default') as conn:
     with conn.cursor() as cur:
         cur.execute("select * from glaquidara_mazzi")
         print cur.getSchema()

         for i in cur.fetch():
             print i

生成以下错误:

回溯(最后一次调用):文件“libra.py”,第 10 行,在 cur.execute("select * from glaquidara_mazzi") 文件“/Library/Python/2.7/site-packages/pyhs2/cursor.py”中,第 64 行,在执行 raise Pyhs2Exception(res.status.errorCode, res.status.errorMessage) pyhs2.error.Pyhs2Exception: '编译语句时出错:FAILED: RuntimeException org.apache.hadoop.ipc.RemoteException: org.apache.hadoop .hdfs.server.namenode.SafeModeException:无法创建目录 /tmp/hive-root/hive_2015-10-07_13-32-30_348_3807878262746902303-3. Name node is in safe mode.\nResources are low on NN. Safe mode must be turned off manually.\n\tat org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInternal(FSNamesystem.java:2140)\n\tat org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:2114)\n\tat org.apache.hadoop.hdfs.server.namenode.NameNode.mkdirs(NameNode.java:892)\n\tat sun.reflect.GeneratedMethodAccessor586.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n\tat java.lang.reflect.Method.invoke(Method.java:597)\n\tat org.apache.hadoop.ipc.RPC$Server.call(RPC.java:557)\n\tat org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1439)\n\tat org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1435)\n\tat java.security.AccessController.doPrivileged(Native Method)\n\tat javax.security.auth.Subject.doAs(Subject.java:396)\n\tat org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1278)\n\tat org.apache.hadoop.ipc.Server$Handler.run(Server.java:1433)\n'

这有什么问题?

4

0 回答 0