尧图建网站 尧图建网站 YAOTU WEB BUILD 免费咨询
ARTICLE DETAIL

资讯详情

深耕网站建设与建站编程的一线实战洞察。

win10搭建hive3开发环境实录

win10搭建hive3开发环境实录 环境准备需要组件组件版本说明JDK8暂时不要选用大于等于JDK9的版本因为启动虚拟机会发生未知异常MySQL8.x用于管理Hive的元数据Apache Hadoop3.3.0Apache Hive3.1.2Apache Hive src1.2.2因为只有1.x版本的Hive源码提供了.bat启动脚本有能力可以自己写脚本就不用下此源码包winutilshadoop-3.3.0Hadoop的Windows系统下的启动依赖部分组件对应的下载地址Apache Hadoop 3.3.0https://mirror.bit.edu.cn/apache/hadoop/common/hadoop-3.3.0/hadoop-3.3.0.tar.gzApache Hive 3.1.2https://mirrors.bfsu.edu.cn/apache/hive/hive-3.1.2/apache-hive-3.1.2-bin.tar.gzApache Hive 1.2.2 srchttps://mirrors.bfsu.edu.cn/apache/hive/hive-1.2.2/apache-hive-1.2.2-src.tar.gzwinutilshttps://github.com/kontext-tech/winutilsMySQL 8.*安装参考https://blog.csdn.net/molaoye/article/details/163566748解压组件到指定目录分别为HADOOP_HOME和HIVE_HOME目录。接着把源码包apache-hive-1.2.2-src.tar.gz解压后的bin目录下的文件拷贝到apache-hive-3.1.2-bin的bin目录中。然后把winutils中的hadoop-3.3.0\bin目录下的hadoop.dll和winutils.exe文件拷贝到Hadoop的解压目录的bin文件夹下。再配置一下HADOOP_HOME环境变量。接着用命令行测试一下如果上述步骤没问题控制台输出如下C:\Users\Administratorhadoop version Hadoop 3.3.0 Source code repository https://gitbox.apache.org/repos/asf/hadoop.git -r aa96f1871bfd858f9bac59cf2a81ec470da649af Compiled by brahma on 2020-07-06T18:44Z Compiled with protoc 3.7.1 From source with checksum 5dc29b802d6ccd77b262ef9d04d19c4 This command was run using /D:/mogx/doc/dev-env/hive3/hadoop-3.3.0/share/hadoop/common/hadoop-common-3.3.0.jar配置和启动Hadoop在HADOOP_HOME的etc\hadoop子目录下找到并且修改下面的几个配置文件「core-site.xml」这里的tmp目录一定要配置一个非虚拟目录别用默认的tmp目录否则后面会遇到权限分配失败的问题configuration property namefs.defaultFS/name valuehdfs://localhost:9000/value /property property namehadoop.tmp.dir/name value/e:/hadoop-3.3.0-data/tmp/value /property /configuration「hdfs-site.xml」这里要预先创建nameNode和dataNode的数据存放目录注意一下每个目录要以左斜杠/开头configuration property namedfs.replication/name value1/value /property property namedfs.http.address/name value0.0.0.0:50070/value /property property namedfs.namenode.name.dir/name value/e:/hadoop-3.3.0-data/nameNode/value /property property namedfs.datanode.data.dir/name value/e:/hadoop-3.3.0-data/dataNode/value /property property namedfs.permissions.enabled/name valuefalse/value /property /configuration「mapred-site.xml」configuration property namemapreduce.framework.name/name valueyarn/value /property /configuration「yarn-site.xml」configuration property nameyarn.nodemanager.aux-services/name valuemapreduce_shuffle/value /property property nameyarn.nodemanager.aux-services.mapreduce.shuffle.class/name valueorg.apache.hadoop.mapred.ShuffleHandler/value /property /configuration至此最小化配置基本完成。接着需要格式化namenode并且启动Hadoop服务。切换至$HADOOP_HOME/bin目录下使用CMD输入命令hdfs namenode -format格式化namenode切记不要重复执行D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\binhdfs namenode -format 2026-08-08 11:41:03,903 INFO namenode.NameNode: STARTUP_MSG: /************************************************************ STARTUP_MSG: Starting NameNode STARTUP_MSG: host mogx/169.254.85.150 STARTUP_MSG: args [-format] STARTUP_MSG: version 3.3.0 STARTUP_MSG: classpath ***.jar STARTUP_MSG: build https://gitbox.apache.org/repos/asf/hadoop.git -r aa96f1871bfd858f9bac59cf2a81ec470da649af; compiled by brahma on 2020-07-06T18:44Z STARTUP_MSG: java 1.8.0_25 ************************************************************/ 2026-08-08 11:41:04,134 INFO namenode.NameNode: createNameNode [-format] 2026-08-08 11:41:05,750 INFO common.Util: Assuming file scheme for path /e:/hadoop-3.3.0-data/nameNode in configuration. 2026-08-08 11:41:05,752 INFO common.Util: Assuming file scheme for path /e:/hadoop-3.3.0-data/nameNode in configuration. 2026-08-08 11:41:05,769 INFO namenode.NameNode: Formatting using clusterid: CID-b579335c-3f69-44c3-b1a6-528518b8a0da 2026-08-08 11:41:05,870 INFO namenode.FSEditLog: Edit logging is async:true 2026-08-08 11:41:05,952 INFO namenode.FSNamesystem: KeyProvider: null 2026-08-08 11:41:05,957 INFO namenode.FSNamesystem: fsLock is fair: true 2026-08-08 11:41:05,960 INFO namenode.FSNamesystem: Detailed lock hold time metrics enabled: false 2026-08-08 11:41:05,991 INFO namenode.FSNamesystem: fsOwner Administrator (auth:SIMPLE) 2026-08-08 11:41:05,991 INFO namenode.FSNamesystem: supergroup supergroup 2026-08-08 11:41:05,994 INFO namenode.FSNamesystem: isPermissionEnabled false 2026-08-08 11:41:05,995 INFO namenode.FSNamesystem: isStoragePolicyEnabled true 2026-08-08 11:41:05,997 INFO namenode.FSNamesystem: HA Enabled: false 2026-08-08 11:41:06,098 INFO common.Util: dfs.datanode.fileio.profiling.sampling.percentage set to 0. Disabling file IO profiling 2026-08-08 11:41:06,129 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit: configured1000, counted60, effected1000 2026-08-08 11:41:06,130 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-checktrue 2026-08-08 11:41:06,141 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000 2026-08-08 11:41:06,142 INFO blockmanagement.BlockManager: The block deletion will start around 2026 八月 08 11:41:06 2026-08-08 11:41:06,147 INFO util.GSet: Computing capacity for map BlocksMap 2026-08-08 11:41:06,148 INFO util.GSet: VM type 64-bit 2026-08-08 11:41:06,158 INFO util.GSet: 2.0% max memory 889 MB 17.8 MB 2026-08-08 11:41:06,158 INFO util.GSet: capacity 2^21 2097152 entries 2026-08-08 11:41:06,248 INFO blockmanagement.BlockManager: Storage policy satisfier is disabled 2026-08-08 11:41:06,248 INFO blockmanagement.BlockManager: dfs.block.access.token.enable false 2026-08-08 11:41:06,737 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.threshold-pct 0.999 2026-08-08 11:41:06,737 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.min.datanodes 0 2026-08-08 11:41:06,740 INFO blockmanagement.BlockManagerSafeMode: dfs.namenode.safemode.extension 30000 2026-08-08 11:41:06,742 INFO blockmanagement.BlockManager: defaultReplication 1 2026-08-08 11:41:06,743 INFO blockmanagement.BlockManager: maxReplication 512 2026-08-08 11:41:06,744 INFO blockmanagement.BlockManager: minReplication 1 2026-08-08 11:41:06,746 INFO blockmanagement.BlockManager: maxReplicationStreams 2 2026-08-08 11:41:06,747 INFO blockmanagement.BlockManager: redundancyRecheckInterval 3000ms 2026-08-08 11:41:06,750 INFO blockmanagement.BlockManager: encryptDataTransfer false 2026-08-08 11:41:06,751 INFO blockmanagement.BlockManager: maxNumBlocksToLog 1000 2026-08-08 11:41:06,809 INFO namenode.FSDirectory: GLOBAL serial map: bits29 maxEntries536870911 2026-08-08 11:41:06,810 INFO namenode.FSDirectory: USER serial map: bits24 maxEntries16777215 2026-08-08 11:41:06,811 INFO namenode.FSDirectory: GROUP serial map: bits24 maxEntries16777215 2026-08-08 11:41:06,812 INFO namenode.FSDirectory: XATTR serial map: bits24 maxEntries16777215 2026-08-08 11:41:06,851 INFO util.GSet: Computing capacity for map INodeMap 2026-08-08 11:41:06,851 INFO util.GSet: VM type 64-bit 2026-08-08 11:41:06,854 INFO util.GSet: 1.0% max memory 889 MB 8.9 MB 2026-08-08 11:41:06,856 INFO util.GSet: capacity 2^20 1048576 entries 2026-08-08 11:41:06,859 INFO namenode.FSDirectory: ACLs enabled? true 2026-08-08 11:41:06,859 INFO namenode.FSDirectory: POSIX ACL inheritance enabled? true 2026-08-08 11:41:06,861 INFO namenode.FSDirectory: XAttrs enabled? true 2026-08-08 11:41:06,863 INFO namenode.NameNode: Caching file names occurring more than 10 times 2026-08-08 11:41:06,885 INFO snapshot.SnapshotManager: Loaded config captureOpenFiles: false, skipCaptureAccessTimeOnlyChange: false, snapshotDiffAllowSnapRootDescendant: true, maxSnapshotLimit: 65536 2026-08-08 11:41:06,890 INFO snapshot.SnapshotManager: SkipList is disabled 2026-08-08 11:41:06,904 INFO util.GSet: Computing capacity for map cachedBlocks 2026-08-08 11:41:06,904 INFO util.GSet: VM type 64-bit 2026-08-08 11:41:06,907 INFO util.GSet: 0.25% max memory 889 MB 2.2 MB 2026-08-08 11:41:06,908 INFO util.GSet: capacity 2^18 262144 entries 2026-08-08 11:41:06,935 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets 10 2026-08-08 11:41:06,935 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users 10 2026-08-08 11:41:06,938 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes 1,5,25 2026-08-08 11:41:06,953 INFO namenode.FSNamesystem: Retry cache on namenode is enabled 2026-08-08 11:41:06,955 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis 2026-08-08 11:41:06,964 INFO util.GSet: Computing capacity for map NameNodeRetryCache 2026-08-08 11:41:06,964 INFO util.GSet: VM type 64-bit 2026-08-08 11:41:06,966 INFO util.GSet: 0.029999999329447746% max memory 889 MB 273.1 KB 2026-08-08 11:41:06,969 INFO util.GSet: capacity 2^15 32768 entries 2026-08-08 11:41:16,117 INFO namenode.FSImage: Allocated new BlockPoolId: BP-2096699510-169.254.85.150-1786160476084 2026-08-08 11:41:16,218 INFO common.Storage: Storage directory E:\hadoop-3.3.0-data\nameNode has been successfully formatted. 2026-08-08 11:41:16,287 INFO namenode.FSImageFormatProtobuf: Saving image file E:\hadoop-3.3.0-data\nameNode\current\fsimage.ckpt_0000000000000000000 using no compression 2026-08-08 11:41:16,520 INFO namenode.FSImageFormatProtobuf: Image file E:\hadoop-3.3.0-data\nameNode\current\fsimage.ckpt_0000000000000000000 of size 408 bytes saved in 0 seconds . 2026-08-08 11:41:16,552 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid 0 2026-08-08 11:41:16,565 INFO namenode.FSImage: FSImageSaver clean checkpoint: txid0 when meet shutdown. 2026-08-08 11:41:16,566 INFO namenode.NameNode: SHUTDOWN_MSG: /************************************************************ SHUTDOWN_MSG: Shutting down NameNode at mogx/169.254.85.150 ************************************************************/格式化namenode完毕后切换至$HADOOP_HOME/sbin目录下执行start-all.cmd脚本会拉起四个JVM实例如果命令行提示start-all.cmd脚本已经过期建议使用start-dfs.cmd和start-yarn.cmd替代。同理如果执行stop-all.cmd也会有类似的提示可以使用stop-dfs.cmd和stop-yarn.cmd替代。此时可以通过jps查看当前的JVM实例D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinjps 10528 NameNode 4228 NodeManager 6904 Jps 8200 DataNode 8476 ResourceManager可见已经启动了ResourceManager、NodeManager、NameNode和DataNode四个应用至此Hadoop的单机版已经启动成功。通过stop-all.cmd命令退出这四个进程。可以通过http://localhost:8088/查看调度任务的状态。可以通过http://localhost:50070/去查看HDFS的状态和文件。重启Hadoop的办法先执行stop-all.cmd脚本再执行start-all.cmd脚本。配置和启动HiveHive是构筑于HDFS上的所以务必确保Hadoop已经启动。Hive在HDFS中默认的文件路径前缀是/user/hive/warehouse因此可以先通过命令行在HDFS中创建此文件夹D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinhdfs dfs -mkdir /user/hive/warehouse mkdir: hdfs://localhost:9000/user/hive: No such file or directory D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinhdfs dfs -mkdir /user/hive mkdir: hdfs://localhost:9000/user: No such file or directory D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinhdfs dfs -mkdir /user D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinhdfs dfs -mkdir /user/hive D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinhdfs dfs -mkdir /user/hive/warehouse D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinhdfs dfs -ls /user/hive Found 1 items drwxr-xr-x - Administrator supergroup 0 2026-08-08 12:01 /user/hive/warehouse D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinhdfs dfs -chmod -R 777 /user/hive/warehouse D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbinhdfs dfs -ls /user/hive Found 1 items drwxrwxrwx - Administrator supergroup 0 2026-08-08 12:01 /user/hive/warehouse D:\mogx\doc\dev-env\hive3\hadoop-3.3.0\sbin不要像本例一样直接建子目录。要先建根目录层层往下建。同时需要创建并为tmp目录赋予权限hdfs dfs -mkdir /tmp hdfs dfs -chmod -R 777 /tmp在系统变量中添加HIVE_HOME。拷贝一个mysql-connector-java-8.0.x.jar到$HIVE_HOME/lib目录下创建Hive的配置文件在$HIVE_HOME/conf目录下已经有对应的配置文件模板需要重命名具体如下hive-default.xml.template hive-site.xmlhive-env.sh.template hive-env.shhive-exec-log4j.properties.template hive-exec-log4j.propertieshive-log4j.properties.template hive-log4j.properties修改hive-env.sh脚本在尾部添加下面内容export HADOOP_HOMED:\mogx\doc\dev-env\hive3\hadoop-3.3.0 export HIVE_CONF_DIRD:\mogx\doc\dev-env\hive3\apache-hive-3.1.2-bin\conf export HIVE_AUX_JARS_PATHD:\mogx\doc\dev-env\hive3\apache-hive-3.1.2-bin\lib修改hive-site.xml文件主要修改下面的属性项属性名属性值说明hive.metastore.warehouse.dir/user/hive/warehouseHive的数据存储目录这个是默认值hive.exec.scratchdir/tmp/hiveHive的临时数据目录这个是默认值javax.jdo.option.ConnectionURLjdbc:mysql://localhost:3306/hive?characterEncodingUTF-8amp;serverTimezoneUTCHive元数据存放的数据库连接javax.jdo.option.ConnectionDriverNamecom.mysql.cj.jdbc.DriverHive元数据存放的数据库驱动javax.jdo.option.ConnectionUserNamerootHive元数据存放的数据库用户javax.jdo.option.ConnectionPasswordrootHive元数据存放的数据库密码hive.exec.local.scratchdirE:/hive-3.1.2-data/scratchDir创建本地目录/scratchDirhive.downloaded.resources.dirE:/hive-3.1.2-data/resourcesDir创建本地目录/resourcesDirhive.querylog.locationE:/hive-3.1.2-data/querylogDir创建本地目录/querylogDirhive.server2.logging.operation.log.locationE:/hive-3.1.2-data/operationDir创建本地目录/operationDirdatanucleus.autoCreateSchematrue可选datanucleus.autoCreateTablestrue可选datanucleus.autoCreateColumnstrue可选hive.metastore.schema.verificationfalse可选修改完毕之后用Navicat新建一个数据库编码和字符集可以选用范围比较大的utf8mb4虽然官方建议是latin1但是字符集往大范围选没有影响上面的准备工作做完之后可以进行Hive的元数据库初始化在$HIVE_HOME/bin目录下执行下面的命令hive --service schematool -dbType mysql -initSchema执行之前先核对hive-site.xml文件的第3215行有个神奇的无法识别的符号#8;要去掉。hive-site.xml文件javax.jdo.option.ConnectionURL值的连接串中的数据库名称。hive-site.xml文件javax.jdo.option.ConnectionUserName值对应数据库用户名。hive-site.xml文件javax.jdo.option.ConnectionPassword值对应数据库用户名的密码。执行后D:\mogx\doc\dev-env\hive3\apache-hive-3.1.2-bin\binhive --service schematool -dbType mysql -initSchema SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/D:/mogx/doc/dev-env/hive3/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/D:/mogx/doc/dev-env/hive3/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/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] 2026-08-08 14:14:19,149 INFO conf.HiveConf: Found configuration file file:/D:/mogx/doc/dev-env/hive3/apache-hive-3.1.2-bin/conf/hive-site.xml 2026-08-08 14:14:20,099 INFO tools.HiveSchemaHelper: Metastore connection URL: jdbc:mysql://localhost:3306/hive_test1?characterEncodingUTF-8serverTimezoneUTC Metastore connection URL: jdbc:mysql://localhost:3306/hive_test1?characterEncodingUTF-8serverTimezoneUTC 2026-08-08 14:14:20,103 INFO tools.HiveSchemaHelper: Metastore Connection Driver : com.mysql.cj.jdbc.Driver Metastore Connection Driver : com.mysql.cj.jdbc.Driver 2026-08-08 14:14:20,107 INFO tools.HiveSchemaHelper: Metastore connection User: root Metastore connection User: root Starting metastore schema initialization to 3.1.0 Initialization script hive-schema-3.1.0.mysql.sql Initialization script completed schemaTool completed这时说明元数据库已经初始化完毕用hive.cmd操作hive在$HIVE_HOME/bin目录下通过hive.cmd可以连接Hive关闭即可退出D:\mogx\doc\dev-env\hive3\apache-hive-3.1.2-bin\binhive.cmd SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/D:/mogx/doc/dev-env/hive3/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/D:/mogx/doc/dev-env/hive3/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/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] 2026-08-08 14:28:05,476 INFO conf.HiveConf: Found configuration file file:/D:/mogx/doc/dev-env/hive3/apache-hive-3.1.2-bin/conf/hive-site.xml Hive Session ID a5e2b815-f8c1-4ca7-a51e-040f14cc1122 2026-08-08 14:28:10,453 INFO SessionState: Hive Session ID a5e2b815-f8c1-4ca7-a51e-040f14cc1122 Logging initialized using configuration in jar:file:/D:/mogx/doc/dev-env/hive3/apache-hive-3.1.2-bin/lib/hive-common-3.1.2.jar!/hive-log4j2.properties Async: true 2026-08-08 14:28:10,569 INFO SessionState: Logging initialized using configuration in jar:file:/D:/mogx/doc/dev-env/hive3/apache-hive-3.1.2-bin/lib/hive-common-3.1.2.jar!/hive-log4j2.properties Async: true 2026-08-08 14:28:12,849 INFO session.SessionState: Created HDFS directory: /tmp/hive/Administrator 2026-08-08 14:28:12,863 INFO session.SessionState: Created HDFS directory: /tmp/hive/Administrator/a5e2b815-f8c1-4ca7-a51e-040f14cc1122 2026-08-08 14:28:12,873 INFO session.SessionState: Created local directory: E:/hive-3.1.2-data/scratchDir/a5e2b815-f8c1-4ca7-a51e-040f14cc1122 2026-08-08 14:28:12,883 INFO session.SessionState: Created HDFS directory: /tmp/hive/Administrator/a5e2b815-f8c1-4ca7-a51e-040f14cc1122/_tmp_space.db 2026-08-08 14:28:12,921 INFO conf.HiveConf: Using the default value passed in for log id: a5e2b815-f8c1-4ca7-a51e-040f14cc1122 2026-08-08 14:28:12,921 INFO session.SessionState: Updating thread name to a5e2b815-f8c1-4ca7-a51e-040f14cc1122 main 2026-08-08 14:28:15,717 INFO metastore.HiveMetaStore: 0: Opening raw store with implementation class:org.apache.hadoop.hive.metastore.ObjectStore 2026-08-08 14:28:15,795 WARN metastore.ObjectStore: datanucleus.autoStartMechanismMode is set to unsupported value null . Setting it to value: ignored 2026-08-08 14:28:15,813 INFO metastore.ObjectStore: ObjectStore, initialize called 2026-08-08 14:28:15,816 INFO conf.MetastoreConf: Found configuration file file:/D:/mogx/doc/dev-env/hive3/apache-hive-3.1.2-bin/conf/hive-site.xml 2026-08-08 14:28:15,819 INFO conf.MetastoreConf: Unable to find config file hivemetastore-site.xml 2026-08-08 14:28:15,819 INFO conf.MetastoreConf: Found configuration file null 2026-08-08 14:28:15,823 INFO conf.MetastoreConf: Unable to find config file metastore-site.xml 2026-08-08 14:28:15,823 INFO conf.MetastoreConf: Found configuration file null 2026-08-08 14:28:16,393 INFO DataNucleus.Persistence: Property datanucleus.cache.level2 unknown - will be ignored 2026-08-08 14:28:17,061 INFO hikari.HikariDataSource: HikariPool-1 - Starting... 2026-08-08 14:28:18,064 INFO hikari.HikariDataSource: HikariPool-1 - Start completed. 2026-08-08 14:28:18,245 INFO hikari.HikariDataSource: HikariPool-2 - Starting... 2026-08-08 14:28:18,295 INFO hikari.HikariDataSource: HikariPool-2 - Start completed. 2026-08-08 14:28:18,794 INFO metastore.ObjectStore: Setting MetaStore object pin classes with hive.metastore.cache.pinobjtypesTable,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order 2026-08-08 14:28:19,152 INFO metastore.MetaStoreDirectSql: Using direct SQL, underlying DB is MYSQL 2026-08-08 14:28:19,156 INFO metastore.ObjectStore: Initialized ObjectStore 2026-08-08 14:28:19,669 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:19,703 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:19,724 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:19,752 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:19,757 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:19,760 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:23,036 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:23,055 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:23,060 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:23,064 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:23,067 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:23,072 WARN DataNucleus.MetaData: Metadata has jdbc-type of null yet this is not valid. Ignored 2026-08-08 14:28:26,665 INFO metastore.HiveMetaStore: Setting location of default catalog, as it hasnt been done after upgrade 2026-08-08 14:28:26,737 WARN metastore.ObjectStore: Failed to get database hive.default, returning NoSuchObjectException 2026-08-08 14:28:26,952 INFO metastore.HiveMetaStore: Added admin role in metastore 2026-08-08 14:28:26,977 INFO metastore.HiveMetaStore: Added public role in metastore 2026-08-08 14:28:27,086 INFO metastore.HiveMetaStore: No user is added in admin role, since config is empty 2026-08-08 14:28:27,588 INFO metastore.RetryingMetaStoreClient: RetryingMetaStoreClient proxyclass org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient ugiAdministrator (auth:SIMPLE) retries1 delay1 lifetime0 2026-08-08 14:28:27,643 INFO metastore.HiveMetaStore: 0: get_all_functions 2026-08-08 14:28:27,648 INFO HiveMetaStore.audit: ugiAdministrator ipunknown-ip-addr cmdget_all_functions Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases. Hive Session ID 7a6257a7-18d8-45ff-bcd3-9d2e4d7c67be 2026-08-08 14:28:27,705 INFO CliDriver: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases. 2026-08-08 14:28:27,705 INFO SessionState: Hive Session ID 7a6257a7-18d8-45ff-bcd3-9d2e4d7c67be 2026-08-08 14:28:27,754 INFO session.SessionState: Created HDFS directory: /tmp/hive/Administrator/7a6257a7-18d8-45ff-bcd3-9d2e4d7c67be 2026-08-08 14:28:27,763 INFO session.SessionState: Created local directory: E:/hive-3.1.2-data/scratchDir/7a6257a7-18d8-45ff-bcd3-9d2e4d7c67be 2026-08-08 14:28:27,787 INFO session.SessionState: Created HDFS directory: /tmp/hive/Administrator/7a6257a7-18d8-45ff-bcd3-9d2e4d7c67be/_tmp_space.db 2026-08-08 14:28:27,797 INFO metastore.HiveMetaStore: 1: get_databases: hive# 2026-08-08 14:28:27,802 INFO HiveMetaStore.audit: ugiAdministrator ipunknown-ip-addr cmdget_databases: hive# 2026-08-08 14:28:27,813 INFO metastore.HiveMetaStore: 1: Opening raw store with implementation class:org.apache.hadoop.hive.metastore.ObjectStore 2026-08-08 14:28:27,816 INFO metastore.ObjectStore: ObjectStore, initialize called 2026-08-08 14:28:27,858 INFO metastore.MetaStoreDirectSql: Using direct SQL, underlying DB is MYSQL 2026-08-08 14:28:27,867 INFO metastore.ObjectStore: Initialized ObjectStore 2026-08-08 14:28:27,901 INFO metastore.HiveMetaStore: 1: get_tables_by_type: dbhive#default pat.*,typeMATERIALIZED_VIEW 2026-08-08 14:28:27,901 INFO HiveMetaStore.audit: ugiAdministrator ipunknown-ip-addr cmdget_tables_by_type: dbhive#default pat.*,typeMATERIALIZED_VIEW 2026-08-08 14:28:27,932 INFO metastore.HiveMetaStore: 1: get_multi_table : dbdefault tbls 2026-08-08 14:28:27,933 INFO HiveMetaStore.audit: ugiAdministrator ipunknown-ip-addr cmdget_multi_table : dbdefault tbls 2026-08-08 14:28:27,941 INFO metadata.HiveMaterializedViewsRegistry: Materialized views registry has been initialized hive 尝试创建一个表t_testhive create table t_test(id INT,name string); hive show tables;查看http://localhost:50070/确认t_test表已经创建成功。尝试执行一个写入语句和查询语句hive insert into t_test(id,name) values(1,throwx); hive select * from t_test;参考https://blog.csdn.net/zjcsuct/article/details/109507769
返回列表