(1)本周做了什么,花在学习上多长时间,花在代码时间上多长时间,花在解决问题用了多长时间。
本周完成了yarn集群和hive数据库的部署
使用的命令如下
su - aaa
cd /export/server/hadoop/etc/hadoop/
ll
vim mapred-env.sh
export JAVA_HOME=/export/server/jdk
export HADOOP_JOB_HISTORYSERVER_HEAPSIZE=1000
export HADOOP_MAPRED_ROOT_LOGGER=INFO,RFA
vim mapred-site.xml
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
<description></description>
</property>
<property>
<name>mapreduce.jobhistory.address</name>
<value>node1:10020</value>
<description></description>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>node1:19888</value>
<description></description>
</property>
<property>
<name>mapreduce.jobhistory.intermediate-done-dir</name>
<value>/data/mr-history/tmp</value>
<description></description>
</property>
<property>
<name>mapreduce.jobhistory.done-dir</name>
<value>/data/mr-history/done</value>
<description></description>
</property>
<property>
<name>yarn.app.mapreduce.am.env</name>
<value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>
<property>
<name>mapreduce.map.env</name>
<value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>
<property>
<name>mapreduce.reduce.env</name>
<value>HADOOP_MAPRED_HOME=$HADOOP_HOME</value>
</property>
vim yarn-env.sh
export JAVA_HOME=/export/server/jdk
export HADOOP_HOME=/export/server/hadoop
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_LOG_DIR=$HADOOP_HOME/logs
vim yarn-site.xml
<property>
<name>yarn.log.server.url</name>
<value>http://node1:19888/jobhistory/logs</value>
<description></description>
</property>
<property>
<name>yarn.web-proxy.address</name>
<value>node1:8089</value>
<description>proxy server hostname and port</description>
</property>
<property>
<name>yarn.log-aggregation-enable</name>
<value>true</value>
<description>Configuration to enable or disable log aggregation</description>
</property>
<property>
<name>yarn.nodemanager.remote-app-log-dir</name>
<value>/tmp/logs</value>
<description>Configuration to enable or disable log aggregation</description>
</property>
<!-- Site specific YARN configuration properties -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>node1</value>
<description></description>
</property>
<property>
<name>yarn.resourcemanager.scheduler.class</name>
<value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>
<description></description>
</property>
<property>
<name>yarn.nodemanager.local-dirs</name>
<value>/data/nm-local</value>
<description>Comma-separated list of paths on the local filesystem where intermediate data is written.</description>
</property>
<property>
<name>yarn.nodemanager.log-dirs</name>
<value>/data/nm-log</value>
<description>Comma-separated list of paths on the local filesystem where logs are written.</description>
</property>
<property>
<name>yarn.nodemanager.log.retain-seconds</name>
<value>10800</value>
<description>Default time (in seconds) to retain log files on the NodeManager Only applicable if log-aggregation is disabled.</description>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
<description>Shuffle service that needs to be set for Map Reduce applications.</description>
</property>
scp mapred-env.sh mapred-site.xml yarn-env.sh yarn-site.xml node2:`pwd`/
scp mapred-env.sh mapred-site.xml yarn-env.sh yarn-site.xml node3:`pwd`/
start-yarn.sh
mapred --daemon start historyserver
#更新密钥 rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 #安装MysqL yum库 rpm -Uvh http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm #yum安装Mysql yum -y install mysql-community-server #启动MySqL 设置开机启动 systemctl start mysqld systemctl enable mysqld #检查MysqL服务状态 systemctl status mysqld #第一次启动mysql,会在日志文件中生成root用户的一个随机密码,使用下面命令查看该密码 grep 'temporary password' /var/log/mysqld.log #如果你想设置简单密码,需要降低MySqL的密码安全级别 set global validate_password_policy=LOW;#密码安全级别低 set global validate_password_length=4;#密码长度最低4位即可 #然后就可以用简单密码了(课程中使用简单密码,为了方便,生产中不要这样) ALTER USER 'root'@'LocaLhost'IDENTIFIED BY '123456'; grant all privileges on *.* to root@"%" identified by '123456' with grant option; flush privileges; cd /export/server/hadoop cd etx/hadoop/ vim core-site.xml <property> <name>hadoop.proxyuser.hadoop.hosts</name> <value>*</value> </property> <property> <name>hadoop.proxyuser.hadoop.groups</name> <value>*</value> </property> tar -zxvf apache-hive-3.1.3-bin.tar.gz -C /export/server/ mv mysql-connector-java-5.1.34.jar /export/server/apache-hive-3.1.3-bin/lib/ cd /export/server/apache-hive-3.1.3-bin/lib cd .. cd .. ln -s /export/server/apache-hive-3.1.3-bin hive cd hive/ cd conf ll mv hive-env.sh.template hive-env.sh ll vim hive-env.sh export HADOOP_HOME=/export/server/hadoop export HIVE_CONF_DIR=/export/server/hive/conf export HIVE_AUX_JARS_PATH=/export/server/hive/lib vim hive-site.xml <configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://node1:3306/hive?createDatabaseIfNotExist=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8</value></property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value></value> </property> <property> <name>hive.server2.thrift.bind.host</name> <value>node1</value> </property> <property> <name>hive.metastore.uris</name> <value>thrift://node1:9083</value> </property> <property> <name>hive.metastore.event.db.notification.api.auth</name> <value>false</value> </property> </configuration> CREATE DATABASE hive CHARSET UTF8; cd /export/server/hive ./schematool -initSchema -dbType mysql -verbos chown -R leap:leap apache-hive-3.1.3-bin hive cd /export/server/hive mkdir logs bin/hive --service metastore nohup bin/hive --service metastore >>logs/metastore.log 2>&1 & bin/hive nohup bin/hive --service hiveserver2 >>logs/hiveserver2.log 2>&1 &
(2)下周准备做什么?
下周准备使用jdbc连接hive数据库
(3)本周遇到的问题?
本周遇到了密钥无法更新的问题,通过更换源镜像解决了
标签:总结,log,hive,yarn,server,第二周,export,进度,HADOOP From: https://www.cnblogs.com/leapssisbird/p/18300530