标签:config col ssl opera name create des nali tab
1 # cd ~/software 2 wget http://mirror.bit.edu.cn/apache/hive/hive-3.1.2/apache-hive-3.1.2-bin.tar.gz
1 tar -xzvf apache-hive-3.1.2-bin.tar.gz 2 mv apache-hive-3.1.2-bin.tar.gz hive
1 # hive home /software/hive 2 export HIVE_HOME=/software/hive 3 export PATH=$PATH:$HIVE_HOME/bin
1 cd /software/hive/conf 2 # 复制并重命名 3 cp hive-env.sh.template hive-env.sh 4 vim hive-env.sh
1 # 相应的目录换成自己的 2 # hadoop 目录 3 HADOOP_HOME=/software/hadoop 4 5 # hive 配置目录 6 export HIVE_CONF_DIR=/software/hive/conf 7 8 # hive 的lib目录 9 export HIVE_AUX_JARS_PATH=/software/hive/lib
1 cd /software/hive/conf 2 # 会自动创建 3 vim hive-site.xml
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 2 <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> 3 <configuration> 4 <!-- jdbc-url --> 5 <property> 6 <name>javax.jdo.option.ConnectionURL</name> 7 <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false</value> 8 </property> 9 <!-- jdbc-driver --> 10 <property> 11 <name>javax.jdo.option.ConnectionDriverName</name> 12 <value>com.mysql.jdbc.Driver</value> 13 </property> 14 <!-- 数据库用户名 --> 15 <property> 16 <name>javax.jdo.option.ConnectionUserName</name> 17 <value>root</value> 18 </property> 19 <!-- 数据密码--> 20 <property> 21 <name>javax.jdo.option.ConnectionPassword</name> 22 <value>*******</value> 23 </property> 24 <property> 25 <name>datanucleus.readOnlyDatastore</name> 26 <value>false</value> 27 </property> 28 <property> 29 <name>datanucleus.fixedDatastore</name> 30 <value>false</value> 31 </property> 32 <property> 33 <name>datanucleus.autoCreateSchema</name> 34 <value>true</value> 35 </property> 36 <property> 37 <name>datanucleus.schema.autoCreateAll</name> 38 <value>true</value> 39 </property> 40 <property> 41 <name>datanucleus.autoCreateTables</name> 42 <value>true</value> 43 </property> 44 <property> 45 <name>datanucleus.autoCreateColumns</name> 46 <value>true</value> 47 </property> 48 <property> 49 <name>hive.metastore.local</name> 50 <value>true</value> 51 </property> 52 <!-- 显示表的列名 --> 53 <property> 54 <name>hive.cli.print.header</name> 55 <value>true</value> 56 </property> 57 <!-- 显示数据库名称 --> 58 <property> 59 <name>hive.cli.print.current.db</name> 60 <value>true</value> 61 </property> 62 <property> 63 <name>hive.exec.local.scratchdir</name> 64 <value>/usr/local/hive</value> 65 <description>Local scratch space for Hive jobs</description> 66 </property> 67 <!-- 自定义目录start --> 68 <property> 69 <name>hive.downloaded.resources.dir</name> 70 <value>/usr/local/hive/hive-downloaded-addDir/</value> 71 <description>Temporary local directory for added resources in the remote file system.</description> 72 </property> 73 <property> 74 <name>hive.querylog.location</name> 75 <value>/usr/local/hive/querylog-location-addDir/</value> 76 <description>Location of Hive run time structured log file</description> 77 </property> 78 <property> 79 <name>hive.server2.logging.operation.log.location</name> 80 <value>/usr/local/hive/hive-logging-operation-log-addDir/</value> 81 <description>Top level directory where operation logs are stored if logging functionality is enabled</description> 82 </property> 83 <!-- 自定义目录end --> 84 </configuration>
1 # 格式化数据库 2 schematool -dbType mysql -initSchema 3 4 # 启动hive 5 hive 6 7 # 查看数据库 8 hive> show databases;
1 cd /software/hive/lib 2 wget http://central.maven.org/maven2/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar
标签:config col ssl opera name create des nali tab
原文地址:https://www.cnblogs.com/dintalk/p/12234726.html