- start sendmail on the host where ambari server runs
- service sendmail start
- ambari web -> alerts -> actions -> manage notifications -> "+"
- name
- test
- groups
- all
- use default value for others
- save
- test
- select one service/component and stop/start it
Monday, November 30, 2015
Ambari - configure email notification using sendmail (HDP)
Manual Upgrade HDP 2.2 to 2.3
- option - local repository setting for HDP 2.2 update (temporary internet access)
- cd /etc/yum.repos.d
- rm -fambari* HDP*
- wget http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.1.0/ambari.repo
- wget http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0/hdp.repo
- yum -y install yum-utils createrepo
- install and run web server
- mkdir -p /var/www/html/
- cd /var/www/html/
- mkdir -p ambari/centos6
- cd ambari/centos6
- reposync -r Updates-ambari-2.1.0
- createrepo Updates-ambari-2.1.0
- cd /var/www/html/
- mkdir -p hdp/centos6
- cd hdp/centos6
- reposync -r HDP-2.3.0.0
- reposync -r HDP-UTILS-1.1.0.20
- createrepo HDP-2.3.0.0
- createrepo HDP-UTILS-1.1.0.20
- edit DocumentRoot and Directory at /usr/local/apache2/conf/httpd.conf or
- cd /usr/local/apache2/htdocs
- ln -s /var/www/html/ambari ambari
- ln -s /var/www/html/hdp hdp
- http://hostname/ambari/centos6/Updates-ambari-2.1.0
- http://hostname/hdp/centos6/HDP-2.3.0.0
- http://hostname/hdp/centos6/HDP-UTILS-1.1.0.20
- option (If you have multiple repositories configured in your environment)
- yum -y install yum-plugin-priorities
- vim /etc/yum/pluginconf.d/priorities.conf
- [main]
- enabled=1
- gpgcheck=0
- stop web server at the end
- /usr/local/apache2/bin/apachectl -k stop
- Upgrading ambari 2.0 to 2.1 (HDP)
- http://mungeol-heo.blogspot.kr/2015/11/upgrading-ambari-20-to-21-hdp.html
- Upgrading ambari metrics (HDP)
- http://mungeol-heo.blogspot.kr/2015/11/upgrading-ambari-metrics-hdp.html
- ambari web -> admin > stack and versions > manage versions > + register version
- enter 0.0
- enter 'http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0' for HDP base URL
- enter 'http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6' for HDP-UTILS base URL
- save
- go to dashboard > admin > stack and versions > verions > install packages > ok
- record component layoutbrowse to each Service except HDFS and ZooKeeper and perform Stop
- namenode (active) hostlog in to ambari
- cd <dfs.namenode.name.dir>
- Make sure that only a "/current" directory and no "/previous" directory exists
- cp -r current /home/hdfs/
- su hdfs
- cd
- hdfs fsck / -files -blocks -locations > dfs-old-fsck-1.log
- hdfs dfsadmin -report > dfs-old-report-1.log
- hdfs dfsadmin -safemode enter
- hdfs dfsadmin -saveNamespace
- hdfs dfsadmin -finalizeUpgrade
- Using Ambari Web, stop HDFS service and stop ZooKeeper service
- namenode (active) hosthdp-select set all 2.3.0.0-2557 (all hosts)
- cd <dfs.namenode.name.dir>/current
- hdfs oev -i edits_inprogress_* -o edits.out
- Verify edits.out file. It should only have OP_START_LOG_SEGMENT transaction
- mkdir -p /work/upgrade_hdp_2
- cd /work/upgrade_hdp_2
- curl -O https://raw.githubusercontent.com/apache/ambari/branch-2.1/ambari-server/src/main/python/upgradeHelper.py
- chmod 777 upgradeHelper.py
- curl -O https://raw.githubusercontent.com/apache/ambari/branch-2.1/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.2_to_2.3.json
- python upgradeHelper.py --hostname $HOSTNAME --user $USERNAME --password $PASSWORD --clustername $CLUSTERNAME --fromStack $FROMSTACK --toStack $TOSTACK --upgradeCatalog UpgradeCatalog_2.2_to_2.3.json update-configs [config-type]curl -O https://raw.githubusercontent.com/apache/ambari/branch-2.1/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.2_to_2.3_step2.json
- ariableValue$HOSTNAMEAmbari Server hostname. This should be the FQDN for the host running the Ambari Server.$USERNAMEAmbari Admin user.$PASSWORDPassword for the user.$CLUSTERNAMEName of the cluster. This is the name you provided when you installed the cluster with Ambari. Login to Ambari and the name can be found in the upper-left of the Ambari Web screen. This is case-sensitive.$FROMSTACKThe “from” stack. Forexample:2.2$TOSTACKThe “to” stack. Forexample:2.3config-typeOptional: the config-type to upgrade. For example:hdfs-site. By default, all configurations are updated.
- upgrade zookeeper
- start it at ambari web
- mv /etc/zookeeper/conf /etc/zookeeper/conf.saved
- ln -s /usr/hdp/current/zookeeper-client/conf /etc/zookeeper/conf
- upgrade HDFS
- \cp -r /etc/hadoop/conf/* /etc/hadoop/2.3.0.0-2557/0/
- mv /etc/hadoop/conf /etc/hadoop/conf.saved
- ln -s /usr/hdp/current/hadoop-client/conf /etc/hadoop/conf
- su -l hdfs -c "/usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh start namenode -upgrade"
- ps -ef | grep -i NameNode
- su -l hdfs -c "/usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh start datanode"
- ps -ef | grep DataNode
- ambari web > services > HDFS > restart all
- run service check
- su -l hdfs -c "hdfs dfsadmin -safemode get"
- safe mode is off
- upgrade YARN and MR2note that you may have to upgrade other services to complete the upgrading which depends on your cluster configuration
- su -l hdfs -c "hdfs dfs -mkdir -p /hdp/apps/2.3.0.0-2557/mapreduce/"
- su -l hdfs -c "hdfs dfs -put /usr/hdp/current/hadoop-client/mapreduce.tar.gz /hdp/apps/2.3.0.0-2557/mapreduce/."
- su -l hdfs -c "hdfs dfs -put /usr/hdp/current/hadoop-mapreduce-client/hadoop-streaming.jar /hdp/apps/2.3.0.0-2557/mapreduce/."
- su -l hdfs -c "hdfs dfs -chown -R hdfs:hadoop /hdp"
- su -l hdfs -c "hdfs dfs -chmod -R 555 /hdp/apps/2.3.0.0-2557/mapreduce"
- su -l hdfs -c "hdfs dfs -chmod -R 444 /hdp/apps/2.3.0.0-2557/mapreduce/mapreduce.tar.gz"
- su -l hdfs -c "hdfs dfs -chmod -R 444 /hdp/apps/2.3.0.0-2557/mapreduce/hadoop-streaming.jar"
- su -l yarn -c "yarn resourcemanager -format-state-store"
- start YARN and MR2 from ambari web
- run service check for YARN and MR2
- sudo su -l hdfs -c "hdfs dfsadmin -finalizeUpgrade"
- ambari-server set-current --cluster-name=dev --version-display-name=HDP-2.3.0.0
- option
- If your cluster includes Ranger
- cd /work/upgrade_hdp_2
- python upgradeHelper.py --hostname $HOSTNAME --user $USERNAME --password $PASSWORD --clustername $CLUSTERNAME --fromStack $FROMSTACK --toStack $TOSTACK --upgradeCatalog UpgradeCatalog_2.2_to_2.3_step2.json update-configs [config-type]
- cd /work/upgrade_hdp_2
- If your cluster includes Ranger
Upgrading ambari 2.0 to 2.1 (HDP)
- stop Ambari Metrics
- ambari-server stop
- all hosts
- ambari-agent stop
- cd /etc/yum.repos.d
- rm -f ambari* HDP*
- wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.1.0/ambari.repo -O /etc/yum.repos.d/ambari.repo
- yum clean all; yum -y upgrade ambari-server
- Confirm there is only one ambari-server*.jar file in /usr/lib/ambari-server. If there is more than one JAR file with name ambari-server*.jar, move all JARs except ambari-server-2.1.0.*.jar to /tmp before proceeding with upgrade
- all hosts
- yum -y upgrade ambari-agent
- rpm -qa | grep ambari-agent
- ambari-server upgrade
- ambari-server start
- ambari-agent start (each host)
- http://<your.ambari.server>:8080
- restart services
- note that you may have to perform other processes to complete the upgrading which depends on your cluster configuration
Upgrading ambari metrics (HDP)
- stop ambari metrics
- all hosts
- yum clean all
- yum -y upgrade ambari-metrics-monitor ambari-metrics-hadoop-sink
- yum -y upgrade ambari-metrics-collector
- start ambari metircs
- restart related services
HDP - verifying memory configuration
- https://github.com/hortonworks/hdp-configuration-utils
- unzip master
- cd hdp-configuration-utils-master/2.1
- ./hdp-configuration-utils.py -h
HDP - log archival process
#!/bin/sh
# Command Line params
# ACTUAL at this time:
# $1 = Interval Days to remove.
DAY_ARCHIVE_THRESHOLD=${1-30}
# $1 = Interval Days to remove.
DAY_ARCHIVE_THRESHOLD=${1-30}
#!/bin/bash
# Cleaning hadoop logs older than 30 days in all hadoop related folders on /var/log
LOG_BASE=/var/log
COMPONENTS="accumulo ambari-agent ambari-server falcon hadoop hadoop-hdfs hadoop-mapreduce hadoop-yarn hbase hive hive-cataglog hue knox nagios oozie storm webhcat zookeeper"
echo "Reviewing Logs for $COMPONENTS"
for i in $COMPONENTS; do
if [ -d $LOG_BASE/$i ]; then
echo "Removing logs for $LOG_BASE/$i that are $DAY_ARCHIVE_THRESHOLD (or more) days old"
find $LOG_BASE/$i -mtime +$DAY_ARCHIVE_THRESHOLD -exec rm -f {} \;
popd
else
echo "Component $i logs not found on this server"
fi
done
for i in $COMPONENTS; do
if [ -d $LOG_BASE/$i ]; then
echo "Removing logs for $LOG_BASE/$i that are $DAY_ARCHIVE_THRESHOLD (or more) days old"
find $LOG_BASE/$i -mtime +$DAY_ARCHIVE_THRESHOLD -exec rm -f {} \;
popd
else
echo "Component $i logs not found on this server"
fi
done
# Cleanup OS Components
OS_COMPONENTS="messages maillog secure spooler"
for i in $OS_COMPONENTS; do
if [ -d $LOG_BASE/$i ]; then
echo "Removing logs for $LOG_BASE/$i that are $DAY_ARCHIVE_THRESHOLD (or more) days old"
find $LOG_BASE/$i-* -mtime +$DAY_ARCHIVE_THRESHOLD -exec rm -f {} \;
popd
else
echo "Component $i logs not found on this server"
fi
done
OS_COMPONENTS="messages maillog secure spooler"
for i in $OS_COMPONENTS; do
if [ -d $LOG_BASE/$i ]; then
echo "Removing logs for $LOG_BASE/$i that are $DAY_ARCHIVE_THRESHOLD (or more) days old"
find $LOG_BASE/$i-* -mtime +$DAY_ARCHIVE_THRESHOLD -exec rm -f {} \;
popd
else
echo "Component $i logs not found on this server"
fi
done
HDP - HDFS performance test
- sudo su hdfs -l -c 'yarn jar /usr/hdp/2.3.0.0-2557/hadoop-mapreduce/hadoop-mapreduce-client-jobclient-tests.jar TestDFSIO -write -nrFiles 10 -fileSize 1000'
- sudo su hdfs -l -c 'yarn jar /usr/hdp/2.3.0.0-2557/hadoop-mapreduce/hadoop-mapreduce-client-jobclient-tests.jar TestDFSIO -read -nrFiles 10 -fileSize 1000'
- sudo su hdfs -l -c 'yarn jar /usr/hdp/2.3.0.0-2557/hadoop-mapreduce/hadoop-mapreduce-client-jobclient-tests.jar TestDFSIO -clean'
Subscribe to:
Posts (Atom)