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

Shell脚本之——Hadoop3单机版安装

目录

1.解压

2.文件重命名

3.配置环境变量

4.hadoop-env.sh

5.core-site.xml

6. hdfs-site.xml

7. mapred-site.xml

8.yarn-site.xml

9.完整脚本代码(注意修改主机名)

10.重启环境变量

11.初始化

12.启动服务

13.jps查询节点


1.解压

tar -zxf /opt/install/hadoop-3.1.3.tar.gz -C /opt/soft/

2.文件重命名

mv /opt/soft/hadoop-3.1.3 /opt/soft/hadoop313

3.配置环境变量

  sed -i '73a\export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop' /etc/profilesed -i '73a\export HADOOP_LIBEXEC_DIR=$HADOOP_HOME/libexec' /etc/profilesed -i '73a\export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native' /etc/profilesed -i '73a\export HADOOP_INSTALL=$HADOOP_HOME' /etc/profilesed -i '73a\export HADOOP_YARN_HOME=$HADOOP_HOME' /etc/profilesed -i '73a\export HADOOP_HDFS_HOME=$HADOOP_HOME' /etc/profilesed -i '73a\export HADOOP_COMMON_HOME=$HADOOP_HOME' /etc/profilesed -i '73a\export HADOOP_MAPRED_HOME=$HADOOP_HOME' /etc/profilesed -i '73a\export YARN_NODEMANAGER_USER=root' /etc/profilesed -i '73a\export YARN_RESOURCEMANAGER_USER=root' /etc/profilesed -i '73a\export HDFS_ZKFC_USER=root' /etc/profilesed -i '73a\export HDFS_JOURNALNODE_USER=root' /etc/profilesed -i '73a\export HDFS_SECONDARYNAMENODE_USER=root' /etc/profilesed -i '73a\export HDFS_DATANODE_USER=root' /etc/profilesed -i '73a\export HDFS_NAMENODE_USER=root' /etc/profilesed -i '73a\export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HADOOP_HOME/lib' /etc/profilesed -i '73a\export HADOOP_HOME=/opt/soft/hadoop313' /etc/profilesed -i '73a\#HADOOP_HOME' /etc/profile

4.hadoop-env.sh

#hadoop-env.shsed -i '53a\export JAVA_HOME=/opt/soft/jdk180'  /opt/soft/hadoop313/etc/hadoop/hadoop-env.sh

5.core-site.xml

#core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>*</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>hadoop.proxyuser.root.groups</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>*</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>hadoop.proxyuser.root.hosts</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <description>读写队列缓存:128k</description>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>131072</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>io.file.buffer.size</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>root</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>hadoop.http.staticuser.user</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <description>namenode上本地的hadoop临时文件夹</description>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>/opt/soft/hadoop313/data</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>hadoop.tmp.dir</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>hdfs://cp145:9000</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>fs.defaultFS</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xml

6. hdfs-site.xml

#hdfs-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <description>关闭权限验证</description>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <value>false</value>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <name>dfs.permissions.enabled</name>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <description>datanode上数据块的物理存储位置目录</description>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <value>/opt/soft/hadoop313/data/dfs/data</value>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <name>dfs.datanode.data.dir</name>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <description>namenode上存储hdfsq名字空间元数据的目录</description>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <value>/opt/soft/hadoop313/data/dfs/name</value>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <name>dfs.namenode.name.dir</name>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <description>hadoop中每一个block文件的备份数量</description>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <value>1</value>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <name>dfs.replication</name>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xml

7. mapred-site.xml

#mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>1024</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.reduce.memory.mb</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>1024</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.map.memory.mb</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>cp145:19888</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.jobhistory.webapp.address</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>cp145:10020</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.jobhistory.address</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>/opt/soft/hadoop313/etc/hadoop:/opt/soft/hadoop313/share/hadoop/common/lib/*:/opt/soft/hadoop313/share/hadoop/common/*:/opt/soft/hadoop313/share/hadoop/hdfs/*:/opt/soft/hadoop313/share/hadoop/hdfs/lib/*:/opt/soft/hadoop313/share/hadoop/mapreduce/*:/opt/soft/hadoop313/share/hadoop/mapreduce/lib/*:/opt/soft/hadoop313/share/hadoop/yarn/*:/opt/soft/hadoop313/share/hadoop/yarn/lib/*</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\   <name>mapreduce.application.classpath</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <final>true</final>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <description>job执行框架:local,classic or yarn</description>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>yarn</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.framework.name</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xml

8.yarn-site.xml

  #yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>/opt/soft/hadoop313/yarndata/log</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.log-dirs</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>/opt/soft/hadoop313/yarndata/yarn</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.local-dirs</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>mapreduce_shuffle</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.aux-services</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>cp145:8042</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.webapp.address</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>cp145:8050</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.address</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>cp145:8040</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.localizer.address</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.resourcemanager.scheduler.class</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>20000</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.resourcemanager.connect.retry-interval.ms</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xml

9.完整脚本代码(注意修改主机名)

#! /bin/bash
echo 'auto install hadoop begining....'#global var
hadoop=trueif [ "$hadoop" = true ];thenecho 'hadoop install set true'echo 'setup hadoop 3'tar -zxf /opt/install/hadoop-3.1.3.tar.gz -C /opt/soft/mv /opt/soft/hadoop-3.1.3 /opt/soft/hadoop313sed -i '73a\export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop' /etc/profilesed -i '73a\export HADOOP_LIBEXEC_DIR=$HADOOP_HOME/libexec' /etc/profilesed -i '73a\export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native' /etc/profilesed -i '73a\export HADOOP_INSTALL=$HADOOP_HOME' /etc/profilesed -i '73a\export HADOOP_YARN_HOME=$HADOOP_HOME' /etc/profilesed -i '73a\export HADOOP_HDFS_HOME=$HADOOP_HOME' /etc/profilesed -i '73a\export HADOOP_COMMON_HOME=$HADOOP_HOME' /etc/profilesed -i '73a\export HADOOP_MAPRED_HOME=$HADOOP_HOME' /etc/profilesed -i '73a\export YARN_NODEMANAGER_USER=root' /etc/profilesed -i '73a\export YARN_RESOURCEMANAGER_USER=root' /etc/profilesed -i '73a\export HDFS_ZKFC_USER=root' /etc/profilesed -i '73a\export HDFS_JOURNALNODE_USER=root' /etc/profilesed -i '73a\export HDFS_SECONDARYNAMENODE_USER=root' /etc/profilesed -i '73a\export HDFS_DATANODE_USER=root' /etc/profilesed -i '73a\export HDFS_NAMENODE_USER=root' /etc/profilesed -i '73a\export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HADOOP_HOME/lib' /etc/profilesed -i '73a\export HADOOP_HOME=/opt/soft/hadoop313' /etc/profilesed -i '73a\#HADOOP_HOME' /etc/profile#hadoop-env.shsed -i '53a\export JAVA_HOME=/opt/soft/jdk180'  /opt/soft/hadoop313/etc/hadoop/hadoop-env.sh#core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>*</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>hadoop.proxyuser.root.groups</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>*</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>hadoop.proxyuser.root.hosts</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <description>读写队列缓存:128k</description>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>131072</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>io.file.buffer.size</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>root</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>hadoop.http.staticuser.user</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <description>namenode上本地的hadoop临时文件夹</description>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>/opt/soft/hadoop313/data</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>hadoop.tmp.dir</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <value>hdfs://cp145:9000</value>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\    <name>fs.defaultFS</name>' /opt/soft/hadoop313/etc/hadoop/core-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/core-site.xml#hdfs-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <description>关闭权限验证</description>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <value>false</value>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <name>dfs.permissions.enabled</name>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <description>datanode上数据块的物理存储位置目录</description>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <value>/opt/soft/hadoop313/data/dfs/data</value>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <name>dfs.datanode.data.dir</name>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <description>namenode上存储hdfsq名字空间元数据的目录</description>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <value>/opt/soft/hadoop313/data/dfs/name</value>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <name>dfs.namenode.name.dir</name>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <description>hadoop中每一个block文件的备份数量</description>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <value>1</value>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\    <name>dfs.replication</name>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/hdfs-site.xml#mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>1024</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.reduce.memory.mb</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>1024</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.map.memory.mb</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>cp145:19888</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.jobhistory.webapp.address</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>cp145:10020</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.jobhistory.address</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>/opt/soft/hadoop313/etc/hadoop:/opt/soft/hadoop313/share/hadoop/common/lib/*:/opt/soft/hadoop313/share/hadoop/common/*:/opt/soft/hadoop313/share/hadoop/hdfs/*:/opt/soft/hadoop313/share/hadoop/hdfs/lib/*:/opt/soft/hadoop313/share/hadoop/mapreduce/*:/opt/soft/hadoop313/share/hadoop/mapreduce/lib/*:/opt/soft/hadoop313/share/hadoop/yarn/*:/opt/soft/hadoop313/share/hadoop/yarn/lib/*</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\   <name>mapreduce.application.classpath</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  </property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <final>true</final>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <description>job执行框架:local,classic or yarn</description>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <value>yarn</value>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\    <name>mapreduce.framework.name</name>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xmlsed -i '19a\  <property>' /opt/soft/hadoop313/etc/hadoop/mapred-site.xml#yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>/opt/soft/hadoop313/yarndata/log</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.log-dirs</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>/opt/soft/hadoop313/yarndata/yarn</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.local-dirs</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>mapreduce_shuffle</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.aux-services</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>cp145:8042</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.webapp.address</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>cp145:8050</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.address</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>cp145:8040</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.nodemanager.localizer.address</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.resourcemanager.scheduler.class</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  </property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <value>20000</value>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\    <name>yarn.resourcemanager.connect.retry-interval.ms</name>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlsed -i '17a\  <property>' /opt/soft/hadoop313/etc/hadoop/yarn-site.xmlecho 'setup hadoop 3 success!!!'
fi

10.重启环境变量

[root@lxm148 opt]# source /etc/profile

11.初始化

[root@lxm148 yarndata]# hdfs namenode -format

12.启动服务

[root@lxm148 yarndata]# start-all.sh

13.jps查询节点

相关文章:

Shell脚本之——Hadoop3单机版安装

目录 1.解压 2.文件重命名 3.配置环境变量 4.hadoop-env.sh 5.core-site.xml 6. hdfs-site.xml 7. mapred-site.xml 8.yarn-site.xml 9.完整脚本代码(注意修改主机名) 10.重启环境变量 11.初始化 12.启动服务 13.jps查询节点 1.解压 tar -zxf /opt/install/hadoo…...

代码随想录NO39 |0-1背包问题理论基础 416.分割等和子集

0-1背包问题理论基础 分割等和子集1. 0-1背包问题理论基础(二维数组实现)2. 0-1背包问题理论基础 二&#xff08;一维数组实现&#xff09;1. 0-1背包问题理论基础(二维数组实现) 背包问题一般分为这几种&#xff1a; 0-1背包问题&#xff1a;有n件物品和一个最多能背重量为w…...

FITC-PEG-FA,荧光素-聚乙二醇-叶酸,FA-PEG-FITC,实验室科研试剂,提供质量检测

FITC-PEG-FA&#xff0c;荧光素-聚乙二醇-叶酸 中文名称&#xff1a;荧光素-聚乙二醇-叶酸 英文名称&#xff1a;FITC-PEG-FA 英文别名&#xff1a;Fluorescein-PEG-Folic Acid 性状&#xff1a;基于不同的分子量&#xff0c;呈白色/类白色固体&#xff0c;或粘稠液体。 溶…...

简洁易懂:源码+实战讲解Redisson并发锁及看门狗自动续期

1 缘起 有一次同事问Redisson存储的键是否为hash&#xff1f; 我当时&#xff0c;没有看Redisson的相关源码&#xff0c;只知道应用&#xff0c; 所以没有办法回答&#xff0c;于是开始看看Redisson实现的源码&#xff0c; 顺便写了一个单机Redisson测试&#xff0c; 发现Redi…...

TCP 三次握手和四次挥手

✏️作者&#xff1a;银河罐头 &#x1f4cb;系列专栏&#xff1a;JavaEE &#x1f332;“种一棵树最好的时间是十年前&#xff0c;其次是现在” 目录TCP 建立连接(三次握手)为啥不能是 4 次&#xff1f;为啥不能是 2 次&#xff1f;三次握手的意义&#xff1a;TCP 断开连接(四…...

JavaWeb复习

JavaWeb复习一.概述1.概念2.B/S和C/S 架构二.HTTP通信协议概述1.概念2.HTTP1.0 与 HTTP1.1 版本3.HTTP 协议组成4.常见状态码5.GET 与 POST 请求方式三.Tomcat1.Web服务器介绍2.安装&#xff08;Windows&#xff09;3.Tomcat目录结构4.server.xml部分配置解释四.Servlet1.概念2…...

P14 PyTorch AutoGrad

前言&#xff1a;激活函数与loss的梯度PyTorch 提供了Auto Grad 功能&#xff0c;这里系统讲解一下torch.autograd.grad系统的工作原理&#xff0c;了解graph 结构目录&#xff1a;1: require_grad False2: require_grad True3&#xff1a; 多层bakcward 原理4&#xff1a; in…...

前端报表如何实现无预览打印解决方案或静默打印

在前端开发中&#xff0c;除了将数据呈现后&#xff0c;我们往往需要为用户提供&#xff0c;打印&#xff0c;导出等能力&#xff0c;导出是为了存档或是二次分析&#xff0c;而打印则因为很多单据需要打印出来作为主要的单据来进行下一环节的票据支撑&#xff0c; 而前端打印可…...

Operating System Course 2 - My OS

Computer Startup process上一篇&#xff1a;http://t.csdn.cn/XfUKt 讲到这个启动设备的第一个扇区&#xff1a;引导扇区。那么引导扇区的代码长什么样子&#xff1f;这里得看引导扇区代码源文件bootsect.s&#xff08;.s后缀文件为用汇编语言编写的源代码文件&#xff09;。另…...

离散数学 课时一 命题逻辑的基本概念

1 命题 1、命题&#xff1a;可以判断其真值的陈述句 2、真值&#xff1a;真或者假(1或者0) 3、真命题&#xff1a;真值为真的命题 4、假命题&#xff1a;真值为假的命题 5、原子命题&#xff1a;不可以再被分解成更简单的命题 6、复合命题&#xff1a;由原子命题通过联结词联结…...

Word文档带有权限密码怎么办?

Word文档的权限密码指的是什么&#xff1f;其实这是Word文档的保护方法之一&#xff0c;具体指Word文档的编辑、修改受到了限制&#xff0c;需要输入密码才能进行。 设置了权限密码的Word文档还是可以直接打开&#xff0c;只有当需要编辑或者修改内容的时候&#xff0c;才会发…...

C++多态

1. 多态的概念1.1 概念多态的概念&#xff1a;通俗来说&#xff0c;就是多种形态&#xff0c;具体点就是去完成某个行为&#xff0c;当不同的对象去完成时会产生出不同的状态举个例子&#xff1a;比如买票这个行为&#xff0c;当普通人买票时&#xff0c;是全价买票&#xff1b…...

访问学者如何申请美国J1签证?

一、申请美国J1签证的步骤&#xff1a; 第一步&#xff1a;填写I901表。 填写I901表会收取SERVIS费用180美元&#xff0c;可以用VISA/Master卡直接网上支付。填完后打印收据单或者存成PDF后续再打印&#xff0c;记下I901收据编号。 第二步&#xff1a;DS-160表填写。 填写DS-…...

使用gitlab ci/cd来发布一个.net 项目

gitlab runner的安装和基本使用:https://bear-coding.blog.csdn.net/article/details/120591711安装并给项目配置完gitlab runner后再操作后面步骤。实现目标&#xff1a;master分支代码有变更的时候自动构建build。当开发人员在gitlab上给项目打一个tag标签分支的时候自动触发…...

笔试题-2023-蔚来-数字芯片设计【纯净题目版】

回到首页:2023 数字IC设计秋招复盘——数十家公司笔试题、面试实录 推荐内容:数字IC设计学习比较实用的资料推荐 题目背景 笔试时间:2022.08.24应聘岗位:校招-芯片逻辑综合工程师-智能硬件笔试时长:90min笔试平台:nowcoder牛客网题目类型:不定项选择题(15道)、填空题…...

ThreadLocal 详解

ThreadLocal简介JDK源码对ThreadLocal类的注释如下&#xff1a;ThreadLocal提供线程局部变量&#xff0c;使得每个线程都有自己的、独立初始化的变量副本ThreadLocal实例通常是类中的private static字段&#xff0c;用于将状态与线程相关联&#xff0c;如用户ID、事务ID只要线程…...

【Java 面试合集】重写以及重载有什么区别能简单说说嘛

重写以及重载有什么区别能简单说说嘛 前述 这是一道非常基础的面试题&#xff0c;我们在回答的过程中一定要逐一横向比较。 从方法的 修饰符&#xff0c;返回值&#xff0c;方法名&#xff0c;含义&#xff0c;参数等方面进行逐一分析来比较不同。 话不多话&#xff0c;看下…...

到底什么是股票委托接口?

在量化股票市场上&#xff0c;常见的股票委托接口其实有着不一样的交集&#xff0c;就拿股票交易接口&#xff0c;在量化股票跟程序化交易中&#xff0c;有共同之处就是在于直接委托执行下单&#xff0c;并且能很快的就能够将策略输出在账户持仓数据中&#xff0c;继续缓存下来…...

Linux驱动:VPU

1. 前言 限于作者能力水平&#xff0c;本文可能存在谬误&#xff0c;因此而给读者带来的损失&#xff0c;作者不做任何承诺。 2. 概述 VPU 是用来进行图像、视频数据进行硬件编、解码的硬件模块。内部集成了 Encoder、Decoder 功能部件进行图像、视频数据进行硬件编、解码&a…...

简介Servlet

目录 一、maven中心库 二、简介Servlet 三、实现Servlet动态页面 1、创建一个maven项目 2、引入依赖 3、创建目录结构 4、编写Servlet代码 5、打包 6、部署 7、验证程序 四、Servlet的运行原理 五、Tomcat伪代码 1、Tomcat初始化 a、让Tomcat先从指定的目录…...

Learning C++ No.7

引言&#xff1a; 北京时间&#xff1a;20223/2/9/22:20&#xff0c;距离大一下学期开学还有2天&#xff0c;昨天收到好消息&#xff0c;开学不要考试了&#xff0c;我并不是害怕考试&#xff0c;考试在我心里&#xff0c;地位不高&#xff0c;可能只有当我挂了&#xff0c;才能…...

【MyBatis】第八篇:一级,二级缓存

其实缓存字面的意思就是将一些内容缓存下来&#xff0c;等下次使用的时候可以直接调用&#xff0c;通过数据库得到数据&#xff0c;有时候会使用相同的数据&#xff0c;所以mybatis自然也支持缓存。 而mybatis按照缓存的效果可以分两大类&#xff1a;一级缓存和二级缓存。 一…...

【大唐杯备考】——5G基站开通与调测(学习笔记)

&#x1f4d6; 前言&#xff1a;本期介绍5G基站开通与调测。 目录&#x1f552; 1. 概述&#x1f552; 2. 5G基站开通与调测基础&#x1f558; 2.1 3.5GHz单模100MHz配置&#xff08;S111&#xff09;&#x1f558; 2.2 3.5GHz单模100MHz配置&#xff08;S111111&#xff09;&a…...

redhat7 忘记root密码,重置办法

来自https://www.tracymc.cn/archives/802 亲测可用&#xff0c;太感谢了&#xff0c;在此记录一下&#xff0c;原文有图 1.启动的时候,在有启动项界面,相应启动项内核名称上按“e”; 2.进入后,找到linux16开头的地方,按“end”键或者controle到最后,输入rd.break,再按ctrlx进…...

QML- 对象属性

QML- 对象属性一、概述二、id 属性三、Property 属性1. 定义属性1. 自定义属性定义中的有效类型2. 为属性属性赋值1. 初始化时的值赋值2. 命令式赋值3. 静态值和绑定表达式值4. 类型安全5. 特殊属性类型1. 对象列表属性2. 分组属性6. 属性别名1. 属性别名的注意事项2. 属性别名…...

将.js文件转成vue标签结构的样式

例如&#xff1a;下图所示&#xff1a; 依次识别获取.js文件中的tag和props&#xff0c;可以理解为字符串拼接&#xff0c;将整个vue的标签结构看作是一个字符串。 话不多说&#xff0c;先放上完整代码&#xff0c;思路看代码备注。&#xff08;自己实现的时候&#xff0c;可以…...

前端知识点复盘

组件和jsx <body><div id"root"></div><script type"text/babel">const root ReactDOM.createRoot(document.getElementById("root"))class App extends React.Component {render() {return (<div> <h1>s…...

前端JavaScript获取图片文件的真实格式

常见方式判断图片格式 当我们进行前端开发&#xff0c;需要处理图片上传功能&#xff0c;针对图片格式做判断时&#xff0c;常规的方法都是使用文件后缀名来判断&#xff0c;如下代码所示&#xff1a; input.addEventListener(change, (e) > {const file e.target.files[…...

今天面了一个来华为要求月薪25K,明显感觉他背了很多面试题...

最近有朋友去华为面试&#xff0c;面试前后进行了20天左右&#xff0c;包含4轮电话面试、1轮笔试、1轮主管视频面试、1轮hr视频面试。 据他所说&#xff0c;80%的人都会栽在第一轮面试&#xff0c;要不是他面试前做足准备&#xff0c;估计都坚持不完后面几轮面试。 其实&…...

11 Advanced CNN

文章目录GoogLeNetInception Module1x1 Conv计算效果代码实现总结ResNet (残差网络)问题引入梯度消失与传统神经网络的比较代码实现课程来源&#xff1a; 链接对于前篇中所提到问题&#xff0c;设计出的是一种类似于LeNet5的线性结构&#xff0c;而对于大多数问题&#xff0c;简…...

效果好的网站建设公司/青岛网站制作公司

剑指offer题目描述&#xff1a; 给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]A[0]*A[1]*...*A[i-1]*A[i1]*...*A[n-1]。不能使用除法。&#xff08;注意&#xff1a;规定B[0] A[1] * A[2] * ... * A[n-1]&#xff0c;B[n-1] A[0] * A[1] * .…...

武昌网站建设价格多少钱/央视网新闻

前言&#xff1a;前面我们都是使用JTAG方式下载比特流文件&#xff0c;然后下载elf文件&#xff0c;最后点击Run as或者Debug as来运行程序。JTAG方式是通过tcl脚本来初始化PS&#xff0c;然后用JTAG收发信息&#xff0c;优点是可以在线调试&#xff0c;缺点是断电后程序就丢失…...

网站建设 招标/优化课程

3、索引与切片 3.1 一维数组 import numpy as nparr1 np.arange(10) print(原始数组,arr1) print(取单独的一个数据) print(arr1[0]) print(arr1[-1]) print(取多个数据) print(arr1[0:-1]) print(arr1[0:3:2])注意点&#xff1a; 1、取单个数据&#xff0c;取下标&#xff…...

工程从立项到竣工流程/seo岗位培训

♚王平&#xff0c;一个IT老码农&#xff0c;写Python十年有余&#xff0c;喜欢专研通过爬虫技术来挣钱。春节贴春联是中国人庆祝春节&#xff08;过年&#xff09;的特有习俗。但我真正对对联有些认识和喜欢&#xff0c;不是从年年贴春联开始的&#xff0c;而是从《唐伯虎点秋…...

网站建设方案的重要性/国际新闻今天

题目看这里 一看求和就知道是要先用前缀和的 让后看到类似相等和不相等的条件&#xff0c;可以考虑并查集 当然这道题由于变量的值一定是0,1所以关系只有不等号也有反传递性&#xff0c;可以直接拆点来做 如果s[i]s[j]那么我们就将i,j所在的并查集合并&#xff0c;将i和j所在的…...

免费视频素材网站哪个最好/站长之家工具高清

WINDOWS 7 PRO X86 2015年9月增量补丁包&#xff0c;从Windowsupdate.log中提取的微软官方下载地址&#xff0c;大部分是2015年9月8日发布的&#xff0c;可以通过下载软件批量下载&#xff1a;http://download.windowsupdate.com/d/msdownload/update/software/secu/2015/08/wi…...