十六.大数据平台及组件安装部署

Hadoop全分布部署

Hadoop集群验证

使用jps查看各个节点启动的进程情况

[hadoop@master ~]$ jps
2224 ResourceManager
2487 Jps
2059 SecondaryNameNode
1852 NameNode
[hadoop@slave1 ~]$ jps
1702 NodeManager
1897 Jps
1612 DataNode
[hadoop@slave2 ~]$ jps
1641 DataNode
1899 NodeManager
2027 Jps

查看Hadoop的web监控页面

http://master:50070http://10.10.10.128:50070 查看NameNode节点启动正常

十六.大数据平台及组件安装部署

http://master:8088http://10.10.10.128:8088 查看所用应用系统启动正常

十六.大数据平台及组件安装部署

十六.大数据平台及组件安装部署

使用Hadoop命令关闭集群

[hadoop@master ~]$ stop-all.sh
This script is Deprecated. Instead use stop-dfs.sh and stop-yarn.sh
Stopping namenodes on [master]
master: stopping namenode
10.10.10.129: stopping datanode
10.10.10.130: stopping datanode
Stopping secondary namenodes [0.0.0.0]
0.0.0.0: stopping secondarynamenode
stopping yarn daemons
stopping resourcemanager
10.10.10.129: stopping nodemanager
10.10.10.130: stopping nodemanager
no proxyserver to stop

Sqoop组件部署

Sqoop数据传输验证

查看Sqoop版本

[hadoop@master ~]$ sqoop-version
Warning: /usr/local/src/sqoop/../hcatalog does not exist! HCatalog jobs will fail.

Please set $HCAT_HOME to the root of your HCatalog installation.

Warning: /usr/local/src/sqoop/../accumulo does not exist! Accumulo imports will fail.

Please set $ACCUMULO_HOME to the root of your Accumulo installation.

22/06/03 14:19:45 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
Sqoop 1.4.7
git commit id 2328971411f57f0cb683dfb79d19d4d19d185dd8
Compiled by maugli on Thu Dec 21 15:59:58 STD 2017

Sqoop连接MySQL数据库

[hadoop@master ~]$ sqoop list-databases --connect jdbc:mysql://127.0.0.1:3306/ --username root -P
Warning: /usr/local/src/sqoop/../hcatalog does not exist! HCatalog jobs will fail.

Please set $HCAT_HOME to the root of your HCatalog installation.

Warning: /usr/local/src/sqoop/../accumulo does not exist! Accumulo imports will fail.

Please set $ACCUMULO_HOME to the root of your Accumulo installation.

22/06/03 14:21:58 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
Enter password:
22/06/03 14:22:08 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

Fri Jun 03 14:22:09 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

information_schema
hive
mysql
performance_schema
sample
sys

Sqoop将HDFS数据导入到MySQL

使用Sqoop将HDFS中的/user/test数据导入MySql中

[hadoop@master ~]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 6
Server version: 5.7.18 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use sample;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from student;
+--------+----------+
| number | name     |
+--------+----------+
| 01     | zhangsan |
| 02     | lisi     |
| 03     | wangwu   |
+--------+----------+
3 rows in set (0.01 sec)

mysql> delete from student;
Query OK, 3 rows affected (0.00 sec)

mysql> select * from student;
Empty set (0.00 sec)

mysql> exit
Bye
[hadoop@master ~]$ sqoop export --connect "jdbc:mysql://127.0.0.1:3306/sample?useUnicode=true&characterEncoding=utf-8" --username root --password Password123! --table student --input-fields-terminated-by ',' --export-dir /user/test
Warning: /usr/local/src/sqoop/../hcatalog does not exist! HCatalog jobs will fail.

Please set $HCAT_HOME to the root of your HCatalog installation.

Warning: /usr/local/src/sqoop/../accumulo does not exist! Accumulo imports will fail.

Please set $ACCUMULO_HOME to the root of your Accumulo installation.

22/06/03 14:30:15 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
22/06/03 14:30:15 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.

22/06/03 14:30:15 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

22/06/03 14:30:15 INFO tool.CodeGenTool: Beginning code generation
Fri Jun 03 14:30:15 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

22/06/03 14:30:15 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM student AS t LIMIT 1
22/06/03 14:30:15 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM student AS t LIMIT 1
22/06/03 14:30:15 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/local/src/hadoop
Note: /tmp/sqoop-hadoop/compile/3db4b67e68b45e1c0c59d60751e87490/student.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

22/06/03 14:30:16 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-hadoop/compile/3db4b67e68b45e1c0c59d60751e87490/student.jar
22/06/03 14:30:16 INFO mapreduce.ExportJobBase: Beginning export of student
SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/usr/local/src/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/src/hbase/lib/slf4j-log4j12-1.7.5.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]
22/06/03 14:30:16 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
22/06/03 14:30:17 WARN mapreduce.ExportJobBase: Input path hdfs://master:9000/user/test does not exist
22/06/03 14:30:17 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative
22/06/03 14:30:17 INFO Configuration.deprecation: mapred.map.tasks.speculative.execution is deprecated. Instead, use mapreduce.map.speculative
22/06/03 14:30:17 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
22/06/03 14:30:17 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
22/06/03 14:30:18 INFO mapreduce.JobSubmitter: Cleaning up the staging area /tmp/hadoop-yarn/staging/hadoop/.staging/job_1654237172618_0003
Warning: /usr/local/src/sqoop/../hcatalog does not exist! HCatalog jobs will fail.

Please set $HCAT_HOME to the root of your HCatalog installation.

Warning: /usr/local/src/sqoop/../accumulo does not exist! Accumulo imports will fail.

Please set $ACCUMULO_HOME to the root of your Accumulo installation.

22/06/03 14:30:15 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
22/06/03 14:30:15 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.

22/06/03 14:30:15 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

22/06/03 14:30:15 INFO tool.CodeGenTool: Beginning code generation
Fri Jun 03 14:30:15 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

22/06/03 14:30:15 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM student AS t LIMIT 1
22/06/03 14:30:15 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM student AS t LIMIT 1
22/06/03 14:30:15 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/local/src/hadoop
Note: /tmp/sqoop-hadoop/compile/3db4b67e68b45e1c0c59d60751e87490/student.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

22/06/03 14:30:16 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-hadoop/compile/3db4b67e68b45e1c0c59d60751e87490/student.jar
22/06/03 14:30:16 INFO mapreduce.ExportJobBase: Beginning export of student
SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/usr/local/src/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/src/hbase/lib/slf4j-log4j12-1.7.5.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]
22/06/03 14:30:16 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar
22/06/03 14:30:17 WARN mapreduce.ExportJobBase: Input path hdfs://master:9000/user/test does not exist
22/06/03 14:30:17 INFO Configuration.deprecation: mapred.reduce.tasks.speculative.execution is deprecated. Instead, use mapreduce.reduce.speculative
22/06/03 14:30:17 INFO Configuration.deprecation: mapred.map.tasks.speculative.execution is deprecated. Instead, use mapreduce.map.speculative
22/06/03 14:30:17 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
22/06/03 14:30:17 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
22/06/03 14:30:18 INFO mapreduce.JobSubmitter: Cleaning up the staging area /tmp/hadoop-yarn/staging/hadoop/.staging/job_1654237172618_0003
22/06/03 14:30:32 INFO mapreduce.Job:  map 0% reduce 0%
22/06/03 14:30:33 INFO mapreduce.Job:  map 100% reduce 0%

通过MySQL命令查看数据是否导入成功

[hadoop@master ~]$ mysql -u root -pPassword123!

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 12
Server version: 5.7.18 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use sample;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from student;
+--------+----------+
| number | name     |
+--------+----------+
| 01     | zhangsan |
| 02     | lisi     |
| 03     | wangwu   |
+--------+----------+
3 rows in set (0.01 sec)

Hive组件部署

Hive组件验证

初始化Hive

[hadoop@master ~]$ schematool -dbType mysql -initSchema
SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/usr/local/src/hive/lib/hive-jdbc-2.0.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/src/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/src/hadoop/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://master:3306/hive?createDatabaseIfNotExist=true&useSSL=false
Metastore Connection Driver :    com.mysql.jdbc.Driver
Metastore connection User:   root
Starting metastore schema initialization to 2.0.0
Initialization script hive-schema-2.0.0.mysql.sql
*** schemaTool completed ***

启动Hive

[hadoop@master ~]$ hive
SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/usr/local/src/hive/lib/hive-jdbc-2.0.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/src/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/src/hadoop/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]

Logging initialized using configuration in jar:file:/usr/local/src/hive/lib/hive-common-2.0.0.jar!/hive-log4j2.properties
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>

Original: https://www.cnblogs.com/kongshuo/p/16339968.html
Author: kongshuo
Title: 十六.大数据平台及组件安装部署

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/585518/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • SSM 集成 Freemarker 模板引擎

    在前后端分离的大趋势下,项目开发过程中,应尽量减少前端和后台的依赖和耦合,前端和后台尽可能采用 ajax 进行交互;但是全站 ajax,不利于网站 SEO,所以引入模板引擎,尽量减…

    Linux 2023年6月14日
    094
  • 每周一个linux命令(nano入门级使用)

    基础环境 nano命令介绍 nano是一个字符编辑软件,类似于vi/vim,比vi/vim简单方便快捷。 安装nano 输入 nano命令,提示未找到此命令,则需要安装,否则无需安…

    Linux 2023年6月8日
    093
  • STM32CubeIDE学习记录(按键点灯工程)

    博主使用的开发板以及相关外设连接如下: 芯片型号为: STM32F103RCT6, 新建STM32CubeIDE项目 配置完成后会生成相应的文件并进入如下界面: 使用外部晶振时钟 …

    Linux 2023年6月14日
    0133
  • 七、软件包管理

    Linux软件管理分类: 1、rpm包管理 —– yum工具2、源码包管理RedhatCentosDebianUbuntu包名.rpm如何获取rpm包?互联…

    Linux 2023年6月7日
    099
  • fastdfs单节点部署

    安装依赖 ​ yum -y install gcc gcc-c++ libevent 安装libfastcommon 下载地址: https://github.com/happyf…

    Linux 2023年6月8日
    0100
  • 你还有什么问题吗?

    在面试过程中,一般都会有一个固定环节,那就是在临近结束时,面试官会问求职者: 你还有什么问题吗? 其实,这是一个很好的了解公司,了解未来团队的机会,但很多求职者却不知道问什么,或者…

    Linux 2023年6月7日
    0109
  • Linux的OpenLava配置

    OpenLava OpenLava是基于LSF早期的开源版本发展而来,其 免费、 开源、 兼容IBM LSF的工作负载调度器。当你需要执行某项业务时候(比如跑渲染之类的),当有服务…

    Linux 2023年6月6日
    0103
  • Linux命令1

    快捷键 1、打开终端 ctrl+alt+t 2、…

    Linux 2023年6月8日
    0112
  • Typora详细教程以及下载

    发现一篇非常不错的 Typora 教程,分享给大家。 原文链接:https://www.cnblogs.com/hyacinthLJP/p/16123932.html 作者:MEl…

    Linux 2023年6月7日
    0148
  • 快速掌握 Base 64 | Java JS 密码系列

    Java 密码系列 – Java 和 JS Base 64 Base 64 不属于密码技术,仅是编码方式。但由于在 Java、JavaScript、区块链等出现的频率较…

    Linux 2023年6月7日
    096
  • MySQL半同步复制的实现和复制过滤器

    当客户端发送给服务端请求时,在等待服务端响应的时候,客户端可以做其他的事情,这样节约了时间,提高了效率。 当客户端发送请求给服务端,在等待服务端响应的请求时,客户端不做其他的事情。…

    Linux 2023年6月7日
    0101
  • 5.1 Vim及其安装

    通过前面的学习我们知道,Linux 系统中”一切皆文件”,因此当我们在命令行下更改文件内容时,不可避免地要用到文本编辑器。 作为一名 Linux 初学者,你…

    Linux 2023年6月7日
    0100
  • JVM学习 运行时数据区 PC寄存器、本地方法栈、虚拟机栈

    2、运行时数据区 哔哩哔哩 尚硅谷视频 宋红康老师 2.1、程序计数器(PC寄存器) 作用 PC寄存器用来存储指向下一条指令的地址,也就是即将要执行指令的代码。由执行引擎读取下一条…

    Linux 2023年6月7日
    0106
  • 【论文笔记】Towards Certifying l-infinity robustness using neural networks with l-infinity-dist neurons

    原文地址 slides GitHub 代码 本文发表于 2021 ICML,提出了一个新颖的神经网络计算方式:对于网络中的每个神经元,不采用传统的线性转换+非线性激活函数的方式,而…

    Linux 2023年6月7日
    081
  • Linux下的文件打包与解压

    tar的命令只用来打包文件,如需要压缩文件就需要调用参数来实现 -c 建立新的&#x…

    Linux 2023年5月27日
    0106
  • AOP实现系统告警

    工作群里的消息怕过于安静,又怕过于频繁 一、业务背景 在开发的过程中会遇到各种各样的开发问题,服务器宕机、网络抖动、代码本身的bug等等。针对代码的bug,我们可以提前预支,通过发…

    Linux 2023年6月13日
    096
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球