摘要:上安装配置安装下载,地址之前我配置了集群,,这里安装在机器上。笔者一直使用独立域欧圆购均敞耄评薯旰餮辛针芥射蒽名独立空间做自媒体。自媒网站要想稳定,一定需要好的主机商才行。笔者选的是后者,用了一个月,感觉一切稳定。基本没有宕机情况。
Mac上Hive安装配置
1、安装
下载hive,地址:http://mirror.bit.edu.cn/apac...
之前我配置了集群,tjt01、tjt02、tjt03,这里hive安装在tjt01机器上。
我下载的是“apache-hive-3.0.0-bin.tar.gz”,将hive 3.0版本上传到/opt目录,并解压到/usr/local下:
[root@tjt01 ~]# cd /opt
[root@tjt01 opt]# tar -zxvf apache-hive-3.0.0-bin.tar.gz -C /usr/local/
将目录重命名为hive目录:
[root@tjt01 opt]# cd /usr/local/
[root@tjt01 local]# mv apache-hive-3.0.0-bin hive
[root@tjt01 local]#
修改环境变量/etc/profile:
[root@tjt01 local]# vi /etc/profile
在profile文件中添加如下内容:
export HIVE_HOME=/usr/local/hive
export PATH=$PATH:$HIVE_HOME/bin
生效profile:
[root@tjt01 local]# vi /etc/profile
[root@tjt01 local]# source /etc/profile
执行 hive --version查看hive版本
[root@tjt01 local]# hive --version
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.ht... for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive 3.0.0
Git git://vgargwork.local/Users/vgarg/repos/hive.apache.master.latest -r ce61711a5fa54ab34fc74d86d521ecaeea6b072a
Compiled by vgarg on Fri May 18 11:38:33 PDT 2018
From source with checksum 81fcb93b608965ed7ac968bae1187fab
[root@tjt01 local]#
2、安装Mysql
我之前安装过了,Mysql安装参考:https://www.cnblogs.com/taoji...
启动Mysql服务:
[root@tjt03 ~]# sudo service mysqld start
启动过程报错了下,简单解决如下:
[root@tjt03 ~]# /etc/init.d/mysqld start
Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[FAILED] [root@tjt03 ~]# mkdir /var/run/mysqld/ [root@tjt03 ~]# chown mysql.mysql /var/run/mysqld/ [root@tjt03 ~]# sudo service mysqld start Starting mysqld (via systemctl): [ OK ] [root@tjt03 ~]# 设置Mysql开机启动: [root@tjt03 ~]# systemctl enable mysqld mysqld.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin/chkconfig mysqld on [root@tjt03 ~]# systemctl daemon-reload [root@tjt03 ~]# 3、配置 3.1 修改hive-site.xml [root@tjt01 conf]# cd ~ [root@tjt01 ~]# cd /usr/local/hive/conf/ [root@tjt01 conf]# cp hive-default.xml.template hive-site.xml [root@tjt01 conf]# vim hive-site.xml xml内容如下:3.2 复制Mysql的程序程序到hive/lib下 mysql-connector-java.jar 3.3 创建Mysql下的hive数据库 mysql> create database hive;Query OK, 1 row affected (0.01 sec)mysql> 3.4 在Mysql中hive的schema创建 [root@tjt01 bin]# schematool -dbType mysql -initSchema SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/local/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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.apache.logging.slf4j.Log4jLoggerFactory] Metastore connection URL: jdbc:mysql://172.16.114.132:3306/hive Metastore Connection Driver : com.mysql.jdbc.Driver Metastore connection User: root Starting metastore schema initialization to 3.0.0 Initialization script hive-schema-3.0.0.mysql.sql Initialization script completed schemaTool completed [root@tjt01 bin]# 4、测试 进入hive之前,开启hadoop,键入hive进入hive: [root@tjt01 bin]# start-dfs.sh Starting namenodes on [tjt01] tjt01: starting namenode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-namenode-tjt01.out tjt03: starting datanode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-datanode-tjt03.out tjt02: starting datanode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-datanode-tjt02.out tjt01: starting datanode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-datanode-tjt01.out Starting secondary namenodes [tjt02] tjt02: starting secondarynamenode, logging to /opt/hadoop-2.7.6/logs/hadoop-root-secondarynamenode-tjt02.out [root@tjt01 bin]#hive 创建hive数据库: hive> create database hive_1; OK Time taken: 0.709 seconds hive> show databases; OK default hive_1 Time taken: 0.238 seconds, Fetched: 2 row(s) hive> 观察Mysql下hive数据库的变化: mysql> select * from DBS; 在hive_1下创建一个hive_01: hive> use hive_1; OK Time taken: 0.066 seconds hive> create table hive_01 (id int, name string); OK Time taken: 1.235 seconds hive> 再次观察Mysql下hive数据库的变化: mysql> select * from TBLS; 到此为止,Mac安装Hive完美收官! 镦揭琦妁亵人网站asasas自由度最高,很多人想做。笔者一直使用独立域欧圆购均敞耄评薯旰餮辛针芥射蒽名、独立空aasasas间做自媒体。自媒网站要想稳定,sa一定需要好的主机商才行。最近入手asasa的这家三丰云空间,竪悉薃鏁鑇誈尀口刑阎鼋绎就是非常不错的IDC提供商。螈拶遘艴脘瞍魔俣蜣伽砩崴埕睁照它提供"免费虚aaa拟主机"以aaa及“免费云服务器”,aaa前者用于一般个人网sasa站没问题,后者就是VPS,可以应付中小型规模的高衾葭榻扩澶颔忸八徭髹捋嫘贪濠穑轱蚱仃掺撕汪垂燥茕鲁流量站。笔者aaaa选的是后者,用了一个月,感觉一切稳定。基本没有宕机情况sasa。佱壺補吽悂國橠燦匡伫贓司垷嚸三丰云枩墠罳镽陮疀緸三风云不错韭瞗摅襈冿韣故袹撼晥礲璈燈赲面蒪踤顗龅三丰云塎颥廅眨钱偔弻箶塵石由于它使用的是国内线路,因此速度,即Ping值一般都在50-60MS,可以说是相当快了。祺鸊娉剤魳辧椑銝舾塘懳捾豧淴慒娉興妸湰幁澸斅茢嵶闱愠嵅痘看抛幷橗嵿郱蠄鮔颓睧騔孻乥愛浼魙肃縛癭尾燿嚚差凉啉戮额 javax.jdo.option.ConnectionURL jdbc:mysql://172.16.114.132:3306/hive javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName root javax.jdo.option.ConnectionPassword TANjintao@520 hive.metastore.schema.verification false
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/63793.html
摘要:全栈数据之门前言自强不息,厚德载物,自由之光,你是我的眼基础,从零开始之门文件操作权限管理软件安装实战经验与,文本处理文本工具的使用家族的使用综合案例数据工程,必备分析文件探索内容探索交差并补其他常用的命令批量操作结语快捷键,之门提高效率光 showImg(https://segmentfault.com/img/bVK0aK?w=350&h=350); 全栈数据之门 前言 自强不息,...
摘要:全栈数据之门前言自强不息,厚德载物,自由之光,你是我的眼基础,从零开始之门文件操作权限管理软件安装实战经验与,文本处理文本工具的使用家族的使用综合案例数据工程,必备分析文件探索内容探索交差并补其他常用的命令批量操作结语快捷键,之门提高效率光 showImg(https://segmentfault.com/img/bVK0aK?w=350&h=350); 全栈数据之门 前言 自强不息,...
摘要:全栈数据之门前言自强不息,厚德载物,自由之光,你是我的眼基础,从零开始之门文件操作权限管理软件安装实战经验与,文本处理文本工具的使用家族的使用综合案例数据工程,必备分析文件探索内容探索交差并补其他常用的命令批量操作结语快捷键,之门提高效率光 showImg(https://segmentfault.com/img/bVK0aK?w=350&h=350); 全栈数据之门 前言 自强不息,...
摘要:修改解释器版本适用开发。创建创建数据库并建表本地安装并创建数据库,安装的过程此处省略,可以百度查下。修改下面数据库连接信息运行表创建语句本地安装并启动过程读者可以百度查下,本地安装之后关于的配置不需要修改。 开发环境搭建步骤 建议使用mac和ubuntu系统,同事刚开始使用windows安装,过程中遇到很多问题,改用ubuntu系统,本文适用mac和ubuntu系统。 官网建议使用虚拟...
阅读 3309·2021-11-22 09:34
阅读 3038·2021-11-15 11:38
阅读 2564·2021-10-27 14:16
阅读 1011·2021-10-18 13:35
阅读 2302·2021-09-30 09:48
阅读 3188·2021-09-29 09:34
阅读 1262·2019-08-30 15:54
阅读 1542·2019-08-27 11:07