Use Case Reddy Chamakura faiked Ambari installation

################################################################################# # Installing HDP 2.3 on CentOS 6.9 ################################################################################# # ssh-keygen # chmod 700 ~/.ssh # cat ~/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys # chmod 600 ~/.ssh/authorized_keys

############ # NTP ############# # yum install -y ntp # chkconfig ntpd on # chkconfig --list ntpd

############ # ip6tables #############

# service ip6tables status # service ip6tables stop # chkconfig ip6tables off # service ip6tables status

############ # iptables ############# # service iptables status

Page | 1

# service iptables save # service iptables stop # chkconfig iptables off service iptables status

############ # Disable SeLINUX ############# # setenforce 0 # cat /etc/selinux/config sed -ie 's/enforcing/disabled/g' /etc/selinux/config

################################ # Disable refresh set enabled=0 ################################

# cat /etc/yum/pluginconf.d/refresh-.conf sed -ie 's/1/0/g' /etc/yum/pluginconf.d/refresh-packagekit.conf.bak

################################ # set umask ################################ # umask 0022 # echo umask 0022 >> /etc/profile

########################################### # Hostname optional ########################################### # vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.220 toronto.canada.ca toronto ########################################### # Get netmask and default gateway optional ########################################### # route -n

# vi /etc/sysconfig/network Add HOSTNAME=toronto.canada.ca (FQDN)

########################################### # DNS optional ########################################### # vi /etc/resolv.conf domain localdomain search localdomain nameserver 192.168.0.1

########################################### # set hostname optional ########################################### # hostname toronto.canada.ca #hostname -f (show give the FQDN set above) # service network restart

########################################### # Disable THP

Page | 2

########################################### # echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled # echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag

########################################### # To disable or make these changes persistent across reboots I add this to the # bottom of my vi /etc/rc.local ########################################### #disable THP at boot time ########################################### if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled fi if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag; then echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag fi

############################################### # Disable network manager optional ################################################### # chkconfig --list NetworkManager # service NetworkManager stop # chkconfig NetworkManager off # chkconfig --list NetworkManager

########################################### # Install latest Java optional ########################################### # cd /opt/ # wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk- 8u144--x64.tar.gz" # tar xzf jdk-8u151-linux-x64.tar.gz # cd /opt/jdk1.8.0_151/ # alternatives --install /usr/bin/java java /opt/jdk1.8.0_151/bin/java 2 # alternatives --config java # alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_151/bin/jar 2 # alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_151/bin/javac 2 # alternatives --set jar /opt/jdk1.8.0_151/bin/jar # alternatives --set javac /opt/jdk1.8.0_151/bin/javac

########################################### # Setup Java Environment Variables optional ########################################### # export JAVA_HOME=/opt/jdk1.8.0_151 # export JRE_HOME=/opt/jdk1.8.0_151/jre # export PATH=$PATH:/opt/jdk1.8.0_151/bin:/opt/jdk1.8.0_151/jre/bin

########################################### # Get the Amabari and HDP bits ############################################

# wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.5.0.3/ambari.repo -O /etc/yum.repos.d/ambari.repo

Page | 3

# wget -nv http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.2.0/hdp.repo -O /etc/yum.repos.d/hdp.repo

########################################### # check the repos were downloaded ############################################ # ls -al /etc/yum.repos.d/ ..... ambari.repo hdp.repo

########################################### #The hdp and ambari repos are accessible below ############################################

# yum repolist Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * base: mirror.yannic-bonenberger.com * extras: linuxsoft.cern.ch * updates: linuxsoft.cern.ch HDP-2.3.2.0 | 2.9 kB 00:00 HDP-2.3.2.0/primary_db | 60 kB 00:00 HDP-UTILS-1.1.0.20 | 2.9 kB 00:00 HDP-UTILS-1.1.0.20/primary_db | 27 kB 00:00 ambari-2.5.0.3 | 2.9 kB 00:00 ambari-2.5.0.3/primary_db | 8.5 kB 00:00 repo id repo name status HDP-2.3.2.0 HDP Version - HDP-2.3.2.0 175 HDP-UTILS-1.1.0.20 HDP Utils Version - HDP-UTILS-1.1.0.20 43 ambari-2.5.0.3 ambari Version - ambari-2.5.0.3 12 base CentOS-6 - Base 6,706 extras CentOS-6 - Extras 47 updates CentOS-6 - Updates 834 repolist: 7,817

################################################## # Install Ambari server ##################################################

# yum install -y ambari-server Loaded plugins: fastestmirror, security Setting up Install Process Loading mirror speeds from cached hostfile * base: mirror.yannic-bonenberger.com

Page | 4

* extras: linuxsoft.cern.ch * updates: linuxsoft.cern.ch Resolving Dependencies --> Running transaction check ---> Package ambari-server.x86_64 0:2.5.0.3-7 will be installed --> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server-2.5.0.3-7.x86_64 --> Running transaction check ---> Package postgresql-server.x86_64 0:8.4.20-8.el6_9 will be installed --> Processing Dependency: postgresql-libs(x86-64) = 8.4.20-8.el6_9 for package: postgresql-server- 8.4.20-8.el6_9.x86_64 --> Processing Dependency: postgresql(x86-64) = 8.4.20-8.el6_9 for package: postgresql-server- 8.4.20-8.el6_9.x86_64 --> Running transaction check ---> Package postgresql.x86_64 0:8.4.20-8.el6_9 will be installed ---> Package postgresql-libs.x86_64 0:8.4.20-2.el6_6 will be updated ---> Package postgresql-libs.x86_64 0:8.4.20-8.el6_9 will be an update --> Finished Dependency Resolution ......

Installed: ambari-server.x86_64 0:2.5.0.3-7 Dependency Installed: postgresql.x86_64 0:8.4.20-8.el6_9 postgresql-server.x86_64 0:8.4.20-8.el6_9 Dependency Updated: postgresql-libs.x86_64 0:8.4.20-8.el6_9 Complete!

################################################## # Install mysql for Ambari set auto for Mysql server ##################################################

# yum install -y mysql-server # chkconfig mysqld --level 345 on # yum install -y mysql-connector-java

################################################# # update the server OS ################################################## # yum update # init 6 ################################################# # Check the auto startup of mysql ################################################## # service mysqld status mysqld (pid 1630) is running...

################################################# # Setup Ambari ################################################## # ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar Ambari Server 'setup' completed successfully.

############################################# # Reset the MySQL root password ##############################################

Page | 5

# mysql -u root UPDATE mysql.user SET Password=PASSWORD('welcome1') WHERE User='root'; flush privileges;

############################################# # Setup Ambari MySQL user and database ##############################################

# mysql -u root -pwelcome1 CREATE USER 'ambari'@'%' IDENTIFIED BY 'ambari'; GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%'; CREATE USER 'ambari'@'localhost' IDENTIFIED BY 'ambari'; GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'localhost'; GRANT ALL PRIVILEGES ON *.* to 'ambari'@'localhost' identified by 'ambari'; GRANT ALL PRIVILEGES ON *.* to 'ambari'@'toronto.canada.ca' identified by 'ambari'; CREATE USER 'ambari'@'bombo.uganda.com' IDENTIFIED BY 'ambari'; GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'toronto.canada.ca'; FLUSH PRIVILEGES;

################################################## # Log on as Ambari user and create the Ambari DB ################################################### mysql -u ambari -pambari

################################################## # Hive,oozie,ranger replace xxxx ################################################ mysql -u root -pwelcome1 create database xxxx; create user oxxxx identified by 'xxxx'; grant all on xxxx.* to xxxx; GRANT ALL PRIVILEGES ON *.* TO 'xxxx'@'localhost' IDENTIFIED BY 'xxxx'; GRANT ALL PRIVILEGES ON *.* TO 'xxxx'@'toronto.canada.ca'IDENTIFIED BY 'xxxx'; flush privileges;

################################################## # Setup ambari-server for Mysql database. ##################################################

# ambari-server setup Using python /usr/bin/python Setup ambari-server Checking SELinux... SELinux status is 'disabled' Customize user account for ambari-server daemon [y/n] (n)? Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... [1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8 [2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7 [3] Custom JDK ======Enter choice (1): 1 To download the Oracle JDK and the Java Cryptography Extension (JCE) Policy Files you must accept the license terms found at http://www.oracle.com/technetwork/java/javase/terms/license/index.html and not accepting will cancel the Ambari Server setup and you must install the JDK and JCE files manually.

Page | 6

Do you accept the Oracle Binary Code License Agreement [y/n] (y)? y Downloading JDK from http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-8u112-linux-x64.tar.gz to /var/lib/ambari-server/resources/jdk-8u112-linux-x64.tar.gz jdk-8u112-linux-x64.tar.gz... 100% (174.7 MB of 174.7 MB) Successfully downloaded JDK distribution to /var/lib/ambari-server/resources/jdk-8u112-linux-x64.tar.gz Installing JDK to /usr/jdk64/ Successfully installed JDK to /usr/jdk64/ Downloading JCE Policy archive from http://public-repo-1.hortonworks.com/ARTIFACTS/jce_policy- 8.zip to /var/lib/ambari-server/resources/jce_policy-8.zip Successfully downloaded JCE Policy archive to /var/lib/ambari-server/resources/jce_policy-8.zip Installing JCE policy... Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? y Configuring database... ======Choose one of the following options: [1] - PostgreSQL (Embedded) [2] - Oracle [3] - MySQL / MariaDB [4] - PostgreSQL [5] - Microsoft SQL Server (Tech Preview) [6] - SQL Anywhere [7] - BDB ======Enter choice (1): 3 Hostname (localhost): Port (3306): Database name (ambari): Username (ambari): Enter Database Password (bigdata): Re-enter password: Configuring ambari database... Copying JDBC drivers to server resources... Configuring remote database connection properties... WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql Proceed with configuring remote database connection properties [y/n] (y)? y Extracting system views...... ambari-admin-2.5.0.3.7.jar ... Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully.

################################################## # Start the ambari server ################################################## # ambari-server start Using python /usr/bin/python Starting ambari-server Ambari Server running with administrator privileges. Organizing resource files at /var/lib/ambari-server/resources... Ambari database consistency check started... Server PID at: /var/run/ambari-server/ambari-server.pid Server out at: /var/log/ambari-server/ambari-server.out Server log at: /var/log/ambari-server/ambari-server.log

Page | 7

Waiting for server start...... Server started listening on 8080 DB configs consistency check: no errors and warnings were found. Ambari Server 'start' completed successfully.

################################################## # Failed check for lzo ##################################################

# yum remove lzo*

And proceed with cluster deployment

Page | 8