您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > educoder平台Hive的安装与配置
第一关Hive的安装与配置cd/opt回车tar-zxvfapache-hive-3.1.0-bin.tar.gz回车mvapache-hive-3.1.0-binhive回车vi/etc/profile按i在末尾添加以下两行代码;exportHIVE_HOME=/opt/hiveexportPATH=$HIVE_HOME/bin:$PATH退出wqsource/etc/profile回车hive--version回车rm/opt/hive/lib/log4j-slf4j-impl-2.10.0.jar回车hive--version回车tar-zxvfmysql-connector-java-5.1.45.tar.gz回车cdmysql-connector-java-5.1.45回车cpmysql-connector-java-5.1.45-bin.jar/opt/hive/lib/回车mysql-uroot-p123123-h127.0.0.1回车createdatabasehiveDB;回车createuser'bee'@'%'identifiedby'123123';回车grantallprivilegesonhiveDB.*to'bee'@'%'identifiedby'123123';回车flushprivileges;回车exit回车cd/opt回车cd/opt/hive/conf回车vihive-site.xml回车将以下内容复制到其中(按i进入编辑模式后再进行粘贴)?xmlversion=1.0encoding=UTF-8standalone=no??xml-stylesheettype=text/xslhref=configuration.xsl?configuration!--WARNING!!!ThisfileisautogeneratedfordocumentationpurposesONLY!--!--WARNING!!!AnychangesyoumaketothisfilewillbeignoredbyHive.--!--WARNING!!!Youmustmakeyourchangesinhive-site.xmlinstead.--!--HiveExecutionParameters--propertynamehive.metastore.warehouse.dir/namevalue/opt/hive/warehouse/value/propertypropertynamehive.exec.scratchdir/namevalue/opt/hive/tmp/value/propertypropertynamehive.querylog.location/namevalue/opt/hive/logs/value/propertypropertynamehive.server2.thrift.port/namevalue10000/value/propertypropertynamehive.server2.thrift.bind.host/namevaluelocalhost/value/propertypropertynamehive.server2.enable.doAs/namevaluetrue/value/propertypropertynamehive.session.id/namevaluefalse/value/propertypropertynamehive.session.silent/namevaluefalse/value/propertypropertynamejavax.jdo.option.ConnectionURL/namevaluejdbc:mysql://localhost:3306/hiveDB?createDatabaseIfNotExist=true/value/propertypropertynamejavax.jdo.option.ConnectionDriverName/namevaluecom.mysql.jdbc.Driver/value/propertypropertynamejavax.jdo.option.ConnectionUserName/namevaluebee/value!--这里是之前设置的数据库--/propertypropertynamejavax.jdo.option.ConnectionPassword/name!--这里是数据库密码--value123123/value/property/configuration完成后,在命令行模式(按Esc),输入:wq保存退出。cphive-env.sh.templatehive-env.sh回车vihive-env.sh回车在最后一行按i粘贴下列代码HADOOP_HOME=/usr/local/hadoop退出wqschematool-dbTypemysql-initSchema回车start-dfs.sh(启动Hadoop)测评———————————————————————————————————————第2关:HiveShell入门基础命令hive;回车createtablestudent(idint,回车namestring,回车ageint);测评
本文标题:educoder平台Hive的安装与配置
链接地址:https://www.777doc.com/doc-7499830 .html