我在32位Windows 7上安装了hive 1.1.0,可以使用hive控制台创建表,查询等,并且可以看到它们已写入hdfs:// users / hive / warehouse
但是我无法启动hiveserver2。输入命令后,它将挂起。下面是控制台打印,请帮助,谢谢!
C:\hive\bin>hive --service hiveserver2
File Not Found
File Not Found
File Not Found
File Not Found
File Not Found
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/hadoop/share/hadoop/common/lib/slf4j-log4j
12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/hive/lib/hive-jdbc-1.1.0-standalone.jar!/o
rg/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf
4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
hive.log
2015-06-02 15:38:46,920 WARN [main]: common.LogUtils (LogUtils.java:logConfigLocation(140)) - DEPRECATED: Ignoring hive-default.xml found on the CLASSPATH at /C:/hive/conf/hive-default.xml
2015-06-02 15:38:47,014 INFO [main]: server.HiveServer2 (HiveStringUtils.java:startupShutdownMessage(662)) - STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting HiveServer2
STARTUP_MSG: host = NWT1302004/10.192.37.175
STARTUP_MSG: args = []
STARTUP_MSG: version = 1.1.0
STARTUP_MSG: classpath = too long, remove, otherwise can't save question
STARTUP_MSG: build = git://localhost.localdomain/Users/noland/workspaces/hive-apache/hive -r 3b87e226d9f2ff5d69385ed20704302cffefab21; compiled by 'noland' on Wed Feb 18 16:06:08 PST 2015
************************************************************/
2015-06-02 15:38:47,030 INFO [main]: server.HiveServer2 (HiveServer2.java:startHiveServer2(303)) - Starting HiveServer2
2015-06-02 15:38:49,409 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:newRawStore(575)) - 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
2015-06-02 15:38:49,613 INFO [main]: metastore.ObjectStore (ObjectStore.java:initialize(269)) - ObjectStore, initialize called
2015-06-02 15:39:05,190 INFO [main]: metastore.ObjectStore (ObjectStore.java:getPMF(350)) - Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order"
2015-06-02 15:39:12,603 INFO [main]: metastore.MetaStoreDirectSql (MetaStoreDirectSql.java:<init>(132)) - Using direct SQL, underlying DB is DERBY
2015-06-02 15:39:12,603 INFO [main]: metastore.ObjectStore (ObjectStore.java:setConf(252)) - Initialized ObjectStore
2015-06-02 15:39:14,678 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:createDefaultRoles_core(649)) - Added admin role in metastore
2015-06-02 15:39:14,678 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:createDefaultRoles_core(658)) - Added public role in metastore
2015-06-02 15:39:14,958 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:addAdminUsers_core(698)) - No user is added in admin role, since config is empty
2015-06-02 15:39:16,767 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created local directory: C:/Users/46172/AppData/Local/Temp/335c6071-cebd-40b8-b4c3-4d77d3e81d48_resources
2015-06-02 15:39:16,798 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created HDFS directory: /tmp/hive/46172/335c6071-cebd-40b8-b4c3-4d77d3e81d48
2015-06-02 15:39:16,798 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created local directory: C:/Users/46172/AppData/Local/Temp/46172/335c6071-cebd-40b8-b4c3-4d77d3e81d48
2015-06-02 15:39:16,798 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created HDFS directory: /tmp/hive/46172/335c6071-cebd-40b8-b4c3-4d77d3e81d48/_tmp_space.db
2015-06-02 15:39:16,798 INFO [main]: session.SessionState (SessionState.java:start(488)) - No Tez session required at this point. hive.execution.engine=mr.
2015-06-02 15:39:21,262 INFO [main]: service.CompositeService (SessionManager.java:initOperationLogRootDir(132)) - Operation log root directory is created: C:\Users\46172\AppData\Local\Temp\46172\operation_logs
2015-06-02 15:39:21,329 INFO [main]: service.CompositeService (SessionManager.java:createBackgroundOperationPool(89)) - HiveServer2: Background operation thread pool size: 100
2015-06-02 15:39:21,329 INFO [main]: service.CompositeService (SessionManager.java:createBackgroundOperationPool(91)) - HiveServer2: Background operation thread wait queue size: 100
2015-06-02 15:39:21,330 INFO [main]: service.CompositeService (SessionManager.java:createBackgroundOperationPool(94)) - HiveServer2: Background operation thread keepalive time: 10 seconds
2015-06-02 15:39:21,433 INFO [main]: service.AbstractService (AbstractService.java:init(89)) - Service:OperationManager is inited.
2015-06-02 15:39:21,433 INFO [main]: service.AbstractService (AbstractService.java:init(89)) - Service:SessionManager is inited.
2015-06-02 15:39:21,433 INFO [main]: service.AbstractService (AbstractService.java:init(89)) - Service:CLIService is inited.
2015-06-02 15:39:21,433 INFO [main]: service.AbstractService (AbstractService.java:init(89)) - Service:ThriftBinaryCLIService is inited.
2015-06-02 15:39:21,433 INFO [main]: service.AbstractService (AbstractService.java:init(89)) - Service:HiveServer2 is inited.
2015-06-02 15:39:21,433 INFO [main]: service.AbstractService (AbstractService.java:start(104)) - Service:OperationManager is started.
2015-06-02 15:39:21,433 INFO [main]: service.AbstractService (AbstractService.java:start(104)) - Service:SessionManager is started.
2015-06-02 15:39:21,433 INFO [main]: service.AbstractService (AbstractService.java:start(104)) - Service:CLIService is started.
2015-06-02 15:39:21,433 INFO [main]: metastore.ObjectStore (ObjectStore.java:initialize(269)) - ObjectStore, initialize called
2015-06-02 15:39:21,433 INFO [main]: metastore.MetaStoreDirectSql (MetaStoreDirectSql.java:<init>(132)) - Using direct SQL, underlying DB is DERBY
2015-06-02 15:39:21,433 INFO [main]: metastore.ObjectStore (ObjectStore.java:setConf(252)) - Initialized ObjectStore
2015-06-02 15:39:21,433 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: get_databases: default
2015-06-02 15:39:21,433 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=get_databases: default
2015-06-02 15:39:21,559 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: Shutting down the object store...
2015-06-02 15:39:21,559 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=Shutting down the object store...
2015-06-02 15:39:21,559 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: Metastore shutdown complete.
2015-06-02 15:39:21,559 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=Metastore shutdown complete.
2015-06-02 15:39:21,559 INFO [main]: service.AbstractService (AbstractService.java:start(104)) - Service:ThriftBinaryCLIService is started.
2015-06-02 15:39:21,559 INFO [main]: service.AbstractService (AbstractService.java:start(104)) - Service:HiveServer2 is started.
2015-06-02 15:50:25,794 WARN [main]: common.LogUtils (LogUtils.java:logConfigLocation(140)) - DEPRECATED: Ignoring hive-default.xml found on the CLASSPATH at /C:/hive/conf/hive-default.xml
2015-06-02 15:50:25,856 INFO [main]: SessionState (SessionState.java:printInfo(852)) -
Logging initialized using configuration in jar:file:/C:/hive/lib/hive-common-1.1.0.jar!/hive-log4j.properties
2015-06-02 15:50:26,152 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:newRawStore(575)) - 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
2015-06-02 15:50:26,199 INFO [main]: metastore.ObjectStore (ObjectStore.java:initialize(269)) - ObjectStore, initialize called
2015-06-02 15:50:29,569 INFO [main]: metastore.ObjectStore (ObjectStore.java:getPMF(350)) - Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order"
2015-06-02 15:50:34,252 INFO [main]: metastore.MetaStoreDirectSql (MetaStoreDirectSql.java:<init>(132)) - Using direct SQL, underlying DB is DERBY
2015-06-02 15:50:34,252 INFO [main]: metastore.ObjectStore (ObjectStore.java:setConf(252)) - Initialized ObjectStore
2015-06-02 15:50:34,424 WARN [main]: metastore.ObjectStore (ObjectStore.java:checkSchema(6599)) - Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 1.1.0
2015-06-02 15:50:34,830 WARN [main]: metastore.ObjectStore (ObjectStore.java:getDatabase(548)) - Failed to get database default, returning NoSuchObjectException
2015-06-02 15:50:35,282 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:createDefaultRoles_core(649)) - Added admin role in metastore
2015-06-02 15:50:35,329 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:createDefaultRoles_core(658)) - Added public role in metastore
2015-06-02 15:50:35,454 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:addAdminUsers_core(698)) - No user is added in admin role, since config is empty
2015-06-02 15:50:35,750 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created local directory: C:/Users/46172/AppData/Local/Temp/bc6dabf4-b50d-4a04-9677-774846caca49_resources
2015-06-02 15:50:35,750 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created HDFS directory: /tmp/hive/46172/bc6dabf4-b50d-4a04-9677-774846caca49
2015-06-02 15:50:35,766 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created local directory: C:/Users/46172/AppData/Local/Temp/46172/bc6dabf4-b50d-4a04-9677-774846caca49
2015-06-02 15:50:35,766 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created HDFS directory: /tmp/hive/46172/bc6dabf4-b50d-4a04-9677-774846caca49/_tmp_space.db
2015-06-02 15:50:35,766 INFO [main]: session.SessionState (SessionState.java:start(488)) - No Tez session required at this point. hive.execution.engine=mr.
2015-06-02 15:50:37,934 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: get_all_databases
2015-06-02 15:50:37,934 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=get_all_databases
2015-06-02 15:50:37,950 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: get_functions: db=default pat=*
2015-06-02 15:50:37,950 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=get_functions: db=default pat=*
2015-06-02 15:50:44,623 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogBegin(121)) - <PERFLOG method=Driver.run from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:50:44,623 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogBegin(121)) - <PERFLOG method=TimeToSubmit from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:50:44,623 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogBegin(121)) - <PERFLOG method=compile from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:50:44,716 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogBegin(121)) - <PERFLOG method=parse from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:50:44,732 INFO [main]: parse.ParseDriver (ParseDriver.java:parse(185)) - Parsing command: version
2015-06-02 15:50:44,982 ERROR [main]: ql.Driver (SessionState.java:printError(861)) - FAILED: ParseException line 1:0 cannot recognize input near 'version' '<EOF>' '<EOF>'
org.apache.hadoop.hive.ql.parse.ParseException: line 1:0 cannot recognize input near 'version' '<EOF>' '<EOF>'
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:202)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:393)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:307)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1112)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1160)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1049)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1039)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:207)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:159)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:370)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:754)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
2015-06-02 15:50:44,982 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogEnd(148)) - </PERFLOG method=compile start=1433231444623 end=1433231444982 duration=359 from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:50:44,982 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogBegin(121)) - <PERFLOG method=releaseLocks from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:50:44,982 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogEnd(148)) - </PERFLOG method=releaseLocks start=1433231444982 end=1433231444982 duration=0 from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:50:44,982 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogBegin(121)) - <PERFLOG method=releaseLocks from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:50:44,982 INFO [main]: log.PerfLogger (PerfLogger.java:PerfLogEnd(148)) - </PERFLOG method=releaseLocks start=1433231444982 end=1433231444982 duration=0 from=org.apache.hadoop.hive.ql.Driver>
2015-06-02 15:51:03,720 WARN [main]: common.LogUtils (LogUtils.java:logConfigLocation(140)) - DEPRECATED: Ignoring hive-default.xml found on the CLASSPATH at /C:/hive/conf/hive-default.xml
2015-06-02 15:51:03,783 INFO [main]: SessionState (SessionState.java:printInfo(852)) -
Logging initialized using configuration in jar:file:/C:/hive/lib/hive-common-1.1.0.jar!/hive-log4j.properties
2015-06-02 15:51:04,487 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:newRawStore(575)) - 0: Opening raw store with implemenation class:org.apache.hadoop.hive.metastore.ObjectStore
2015-06-02 15:51:04,518 INFO [main]: metastore.ObjectStore (ObjectStore.java:initialize(269)) - ObjectStore, initialize called
2015-06-02 15:51:07,888 INFO [main]: metastore.ObjectStore (ObjectStore.java:getPMF(350)) - Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypes="Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order"
2015-06-02 15:51:09,666 INFO [main]: metastore.MetaStoreDirectSql (MetaStoreDirectSql.java:<init>(132)) - Using direct SQL, underlying DB is DERBY
2015-06-02 15:51:09,666 INFO [main]: metastore.ObjectStore (ObjectStore.java:setConf(252)) - Initialized ObjectStore
2015-06-02 15:51:09,838 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:createDefaultRoles_core(649)) - Added admin role in metastore
2015-06-02 15:51:09,838 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:createDefaultRoles_core(658)) - Added public role in metastore
2015-06-02 15:51:09,869 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:addAdminUsers_core(698)) - No user is added in admin role, since config is empty
2015-06-02 15:51:10,481 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created local directory: C:/Users/46172/AppData/Local/Temp/320de2e6-0f30-408b-b8f1-e65869a939ea_resources
2015-06-02 15:51:10,496 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created HDFS directory: /tmp/hive/46172/320de2e6-0f30-408b-b8f1-e65869a939ea
2015-06-02 15:51:10,496 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created local directory: C:/Users/46172/AppData/Local/Temp/46172/320de2e6-0f30-408b-b8f1-e65869a939ea
2015-06-02 15:51:10,496 INFO [main]: session.SessionState (SessionState.java:createPath(586)) - Created HDFS directory: /tmp/hive/46172/320de2e6-0f30-408b-b8f1-e65869a939ea/_tmp_space.db
2015-06-02 15:51:10,496 INFO [main]: session.SessionState (SessionState.java:start(488)) - No Tez session required at this point. hive.execution.engine=mr.
2015-06-02 15:51:11,027 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: get_all_databases
2015-06-02 15:51:11,027 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=get_all_databases
2015-06-02 15:51:11,042 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: get_functions: db=default pat=*
2015-06-02 15:51:11,042 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=get_functions: db=default pat=*
2015-06-02 16:12:31,212 INFO [Thread-6]: server.HiveServer2 (HiveServer2.java:stop(269)) - Shutting down HiveServer2
2015-06-02 16:12:31,228 INFO [Thread-2]: server.HiveServer2 (HiveStringUtils.java:run(680)) - SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down HiveServer2 at NWT1302004/10.192.37.175
************************************************************/
2015-06-02 16:12:31,228 INFO [Thread-7]: thrift.ThriftCLIService (ThriftBinaryCLIService.java:run(98)) - Started ThriftBinaryCLIService on port 10000 with 5...500 worker threads
2015-06-02 16:12:31,228 INFO [Thread-6]: thrift.ThriftCLIService (ThriftCLIService.java:stop(138)) - Thrift server has stopped
2015-06-02 16:12:31,228 INFO [Thread-6]: service.AbstractService (AbstractService.java:stop(125)) - Service:ThriftBinaryCLIService is stopped.
2015-06-02 16:12:31,228 INFO [Thread-6]: service.AbstractService (AbstractService.java:stop(125)) - Service:OperationManager is stopped.
2015-06-02 16:12:31,228 INFO [Thread-6]: service.AbstractService (AbstractService.java:stop(125)) - Service:SessionManager is stopped.
2015-06-02 16:12:31,228 INFO [Thread-6]: service.AbstractService (AbstractService.java:stop(125)) - Service:CLIService is stopped.
2015-06-02 16:12:31,228 INFO [Thread-6]: service.AbstractService (AbstractService.java:stop(125)) - Service:HiveServer2 is stopped.
最佳答案
我使用mysql作为metastore,hiveserver2现在可以启动:
2015-06-03 10:37:36,863 INFO [main]: metastore.MetaStoreDirectSql (MetaStoreDirectSql.java:<init>(132)) - Using direct SQL, underlying DB is MYSQL
2015-06-03 10:37:36,863 INFO [main]: metastore.ObjectStore (ObjectStore.java:setConf(252)) - Initialized ObjectStore
2015-06-03 10:37:36,879 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: get_databases: default
2015-06-03 10:37:36,879 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=get_databases: default
2015-06-03 10:37:36,910 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: Shutting down the object store...
2015-06-03 10:37:36,910 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=Shutting down the object store...
2015-06-03 10:37:36,910 INFO [main]: metastore.HiveMetaStore (HiveMetaStore.java:logInfo(732)) - 0: Metastore shutdown complete.
2015-06-03 10:37:36,910 INFO [main]: HiveMetaStore.audit (HiveMetaStore.java:logAuditEvent(358)) - ugi=46172 ip=unknown-ip-addr cmd=Metastore shutdown complete.
2015-06-03 10:37:36,910 INFO [main]: service.AbstractService (AbstractService.java:start(104)) - Service:ThriftBinaryCLIService is started.
2015-06-03 10:37:36,926 INFO [main]: service.AbstractService (AbstractService.java:start(104)) - Service:HiveServer2 is started.
关于hadoop - Windows 'File Not Found'上的hiveserver2并挂起,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30591190/