当前位置: 首页 > news >正文

德阳网站建设平台张家港杨舍网站建设

德阳网站建设平台,张家港杨舍网站建设,江苏省建筑网监督信息平台,找设计师文章目录Hadoop 运行环境搭建#xff08;开发重点#xff09;一、安装JDK二、安装配置 Hadoop1、安装 hadoop2、hadoop 目录结构3、设置免密登录4、完全分布式模式#xff08;开发重点#xff09;1#xff09;分发jdk2#xff09;集群配置(1) 集群部署规划(2) 配置文件说… 文章目录Hadoop 运行环境搭建开发重点一、安装JDK二、安装配置 Hadoop1、安装 hadoop2、hadoop 目录结构3、设置免密登录4、完全分布式模式开发重点1分发jdk2集群配置(1) 集群部署规划(2) 配置文件说明(3) 配置集群4) 集群基本测试(1) 上传文件到集群5) 配置历史服务器Hadoop 运行环境搭建开发重点 一、安装JDK 将 hadoop 的安装包和 jdk 的安装包上传到 hadoop102 的 /opt/software 目录下 输入命令tar -zxvf jdk-8u212-linux-x64.tar.gz -C /opt/ 将jdk压缩包解压到 /opt 目录下 输入命令 mv jdk1.8.0_212/ jdk1.8 包的名字太长了我们给他改成jdk1.8 然后接下来配置jdk的环境变量 输入命令vim /etc/profile 添加以下的变量 export JAVA_HOME/opt/jdk1.8 export PATH$PATH:$JAVA_HOME/bin输入命令source /etc/profile 保存配置 输入命令java -version 可以看到jdk安装成功了 二、安装配置 Hadoop 1、安装 hadoop 将 /opt/software 目录下的hadoop压缩包解压到 /opt 目录下 输入命令: tar -zxvf hadoop-3.1.3.tar.gz -C /opt 可以看到 opt目录下就有hadoop包了 输入命令vim /etc/profile 配置Hadoop的环境变量 export HADOOP_HOME/opt/hadoop-3.1.3 export PATH$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH export HDFS_NAMENODE_USERroot export HDFS_DATANODE_USERroot export HDFS_SECONDARYNAMENODE_USERroot输入命令source /etc/profile 让环境生效 输入命令hadoop version可以看到hadoop安装成功 2、hadoop 目录结构 查看 hadoop 的目录结构 hdfs 是存储的mapred 是计算的yarn是资源调度的 hadoop 重要目录 1bin 目录存放对 Hadoop 相关服务hdfsyarnmapred进行操作的脚本 2etc 目录Hadoop 的配置文件目录存放 Hadoop 的配置文件 3lib 目录存放 Hadoop 的本地库对数据进行压缩解压缩功能 4sbin 目录存放启动或停止 Hadoop 相关服务的脚本 5share 目录存放 Hadoop 的依赖 jar 包、文档、和官方案例 3、设置免密登录 输入命令cd .ssh 输入命令ssh-keygen -t rsa 然后按三次回车 就会生成两个文件 id_rsa私钥、id_rsa.pub公钥 将公钥拷将公钥拷贝到要免密登录的目标机器上 ssh-copy-id hadoop102 ssh-copy-id hadoop103 ssh-copy-id hadoop104 现在登录到其他的虚拟机上就不会输密码了 注意 还需要在 hadoop103 上采用 root 账号配置一下无密登录到 hadoop102、hadoop103、 hadoop104 服务器上。 还需要在 hadoop104 上采用 root 账号配置一下无密登录到 hadoop102、hadoop103、 hadoop104 服务器上。 还需要在 hadoop102 上采用 root 账号配置一下无密登录到 hadoop102、hadoop103、 hadoop104 4、完全分布式模式开发重点 1准备三台客户机关闭防火墙静态IP主机名称 2安装JDK 3配置环境变量 4安装 Hadoop 5配置环境变量 6配置集群 7单点启动 8配置ssh 9群起并测试集群 1分发jdk 在 hadoop102 上将hadoop12 中 /opt/jdk1.8 目录拷贝到 hadoop103hadoop104 上面去 输入命令scp -r $JAVA_HOME roothadoop103:/opt 输入命令scp -r $JAVA_HOME roothadoop104:/opt 可以看到 hadoop103 和 hadoop104 也有jdk文件了 hadoop 也是同样的拷贝拷贝到 hadoop103 和 hadoop104 输入命令 scp -r $HADOOP_HOME roothadoop103:/opt 可以看到hadoop103 和 hadoop104 也有hadoop包了 2集群配置 (1) 集群部署规划 注意 NameNode 和 SecondaryNameNode 不要安装在同一台服务器 ResourceManager 也很消耗内存不要和 NameNode、SecondaryNameNode 配置在 同一台机器上 (2) 配置文件说明 Hadoop 配置文件分两类默认配置文件和自定义配置文件只有用户想修改某一默认 配置值时才需要修改自定义配置文件更改相应属性值。 1、默认配置文件 2、自定义配置文件 core-site.xml、hdfs-site.xml、yarn-site.xml、mapred-site.xml 四个配置文件存放在 $HADOOP_HOME/etc/hadoop 这个路径上用户可以根据项目需求重新进行修改配置 (3) 配置集群 1、核心配置文件 配置 core-site.xml 输入命令cd $HADOOP_HOME/etc/hadoop 进入hadoop的配置的目录 输入命令vim core-site.xml 配置core-site.xml 文件 ?xml version1.0 encodingUTF-8? ?xml-stylesheet typetext/xsl hrefconfiguration.xsl? !--Licensed under the Apache License, Version 2.0 (the License);you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an AS IS BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. See accompanying LICENSE file. --!-- Put site-specific property overrides in this file. --configuration!-- 指定 NameNode 的地址 --propertynamefs.defaultFS/namevaluehdfs://hadoop102:8020/value/property!-- 指定 hadoop 数据的存储目录 --propertynamehadoop.tmp.dir/namevalue/opt/hadoop-3.1.3/data/value/property!-- 配置 HDFS 网页登录使用的静态用户为 atguigu --propertynamehadoop.http.staticuser.user/namevalueaex/value/property /configuration2、HDFS 配置文件 配置 hdfs-site.xml 输入命令vim hdfs-site.xml ?xml version1.0 encodingUTF-8? ?xml-stylesheet typetext/xsl hrefconfiguration.xsl? !--Licensed under the Apache License, Version 2.0 (the License);you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an AS IS BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. See accompanying LICENSE file. --!-- Put site-specific property overrides in this file. --configuration !-- nn web 端访问地址-- propertynamedfs.namenode.http-address/namevaluehadoop102:9870/value/property !-- 2nn web 端访问地址--propertynamedfs.namenode.secondary.http-address/namevaluehadoop104:9868/value/property /configuration3、YARN 配置文件 配置yarn-site.xml 输入命令vim yarn-site.xml ?xml version1.0? !--Licensed under the Apache License, Version 2.0 (the License);you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an AS IS BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. See accompanying LICENSE file. -- configuration!-- 指定 MR 走 shuffle --propertynameyarn.nodemanager.aux-services/namevaluemapreduce_shuffle/value/property!-- 指定 ResourceManager 的地址--propertynameyarn.resourcemanager.hostname/namevaluehadoop103/value/property!-- 环境变量的继承 --propertynameyarn.nodemanager.env-whitelist/namevalueJAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CO NF_DIR,CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME,HADOOP_MAP RED_HOME/value/property /configuration4、MapReduce 配置文件 输入命令vim mapred-site.xml ?xml version1.0? ?xml-stylesheet typetext/xsl hrefconfiguration.xsl? !--Licensed under the Apache License, Version 2.0 (the License);you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an AS IS BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. See accompanying LICENSE file. --!-- Put site-specific property overrides in this file. --configuration !-- 指定 MapReduce 程序运行在 Yarn 上 --propertynamemapreduce.framework.name/namevalueyarn/value/property /configuration5、在集群上分发1配置好的Hadoop配置文件 输入命令 scp -r $HADOOP_HOME roothadoop103:$HADOOP_HOME 将配置分发给hadoop103 输入命令 scp -r $HADOOP_HOME roothadoop104:$HADOOP_HOME 将配置分发给hadoop104 6、配置worekers 输入命令vim worekers 5、进行初始化 输入命令hdfs namenode -format 下面会出现很长一串 启动节点 输入命令start-all.sh 在webUI 界面上查看 hdfs浏览器输入 hadoop102:9870 4) 集群基本测试 (1) 上传文件到集群 输入命令hdfs dfs -mkdrir /input 先在hdfs上创建一个 input目录 可以看到 hdfs 上已经有这个文件了 上传一个文件上去 输入命令 hdfs dfs -put jdk-8u212-linux-x64.tar.gz /input 可以看到文件已经上传上去了 5) 配置历史服务器 为了查看程序的历史运行情况需要配置一下历史服务器具体配置如下 1、配置 mapred-site.xml 输入命令vim mapred-site.xml ?xml version1.0? ?xml-stylesheet typetext/xsl hrefconfiguration.xsl? !--Licensed under the Apache License, Version 2.0 (the License);you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an AS IS BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. See accompanying LICENSE file. --!-- Put site-specific property overrides in this file. --configuration !-- 指定 MapReduce 程序运行在 Yarn 上 --propertynamemapreduce.framework.name/namevalueyarn/value/property !-- 历史服务器端地址 -- propertynamemapreduce.jobhistory.address/namevaluehadoop102:10020/value /property !-- 历史服务器 web 端地址 -- propertynamemapreduce.jobhistory.webapp.address/namevaluehadoop102:19888/value /property /configuration2、分发配置 输入命令scp -r /opt/hadoop-3.1.3/etc/hadoop/mapred-site.xml roothadoop103:/opt/hadoop-3.1.3/etc/hadoop/mapred-site.xml mapred-site.xml 输入命令scp -r /opt/hadoop-3.1.3/etc/hadoop/mapred-site.xml roothadoop104:/opt/hadoop-3.1.3/etc/hadoop/mapred-site.xml mapred-site.xml 3、在hadoop102启动历史服务器 输入命令mapred --daemon start historyserver
http://www.w-s-a.com/news/3966/

相关文章:

  • 怎么查网站是在哪里备案的广州电力建设有限公司网站
  • 做网站自己申请域名还是对方wordpress管理地址
  • 专门做二手书网站或appwordpress首页显示特定分类文章
  • 无锡网站设计厂家一建十个专业含金量排名
  • 网站刷链接怎么做成都高度网站技术建设公司
  • flash网站模板怎么用xml网站地图生成
  • 英文网站优化群晖wordpress中文
  • saas建站平台源码济南品牌网站建设公司
  • 网站建设一般是用哪个软件网站百度
  • 企业建站的作用是什么南宁公司网站开发
  • 厦门网站建设及维护门户网站开发视频教学
  • 可以做兼职的网站有哪些自动点击器永久免费版
  • 建购物网站怎么建呀网站怎么做中英文交互
  • 网站建设费用计入无形资产做网站用的主机
  • 佛山企业网站建设平台沈阳网站建设培训班
  • 河南企业网站优化外包网站怎么做来流量
  • 网站建设的参考文献网站设计网页的优缺点
  • WordPress多站點支付插件内江市网站建设培训
  • 做做网站已更新动漫制作专业需要学什么
  • dfv印花图案设计网站网站建设应该应聘什么岗位
  • 网站后台管理系统模板下载专业网站推广的公司哪家好
  • 克拉玛依市建设局网站网页设计板式重构
  • 网站新闻专题怎么做湖南营销型网站建设 要上磐石网络
  • 阿里云发布网站成都轨迹公布
  • php网站源码架构谷歌站群系统
  • 潮州网站seowordpress 调用置顶文章
  • 做带会员后台的网站用什么软件旅游网站建设资金请示
  • 商品网站怎么做wordpress 表情拉长
  • 商城网站设计费用网络公司怎样推广网站
  • 视频公司的网站设计工图网