###################################################################################### # Installing HDP 2.4 on CentOS 7 ###################################################################################### [root@london ~]# ssh-keygen [root@london ~]# chmod 700 ~/.ssh [root@london]# cat ~/.ssh/id_rsa.pub >> authorized_keys [root@london]# chmod 600 ~/.ssh/authorized_keys [root@london]# yum install -y ntp [root@london]# service ip6tables stop [root@london]# chkconfig ip6tables off [root@london]# service iptables save [root@london]# service iptables stop [root@london]# chkconfig iptables off [root@london]# setenforce 0 [root@london]# vi /etc/selinux/config Set SELINUX=disabled [root@london]# vi /etc/yum/pluginconf.d/refresh-packagekit.conf set enabled=0 [root@london]# umask 0022 [root@london]# echo umask 0022 >> /etc/profile ########################################### # Hostname ########################################### [root@localhost]# vi /etc/hosts 192.168.0.104 london.hadoop.com london [root@localhost .ssh]# route -n IPADDR=192.168.0.104 NETMASK=255.255.255.0 DNS1= 192.168.0.1 #Get by route -n cmd [root@localhost] vi /etc/sysconfig/network Add HOSTNAME=london.hadoop.com [root@london]# vi /etc/resolv.conf domain localdomain search localdomain nameserver 192.168.0.157 [root@london]# hostname london.hadoop.com [root@london]# service network restart ########################################### # Disable THP ########################################### [root@london] # echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled [root@london] # 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 ########################################### # Update your system ########################################### [root@london]# yum install mysql mysql-server [root@london]# chkconfig mysqld --level 345 on [root@london]# yum install mysql-connector-java [root@london]# service mysqld start [root@london]# yum update [root@london]# init 6 ############################################# # Install MySQL database for Ambari ############################################## [root@london]# mysql -u root UPDATE mysql.user SET Password=PASSWORD('welcome1') WHERE User='root'; flush privileges; ########################################### # Get the Amabari and HDP bits ############################################ [root@london]# wget -nv http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari.repo -O /etc/yum.repos.d/ambari.repo [root@london]# wget -nv http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.4.3.0/hdp.repo -O /etc/yum.repos.d/hdp.repo [root@london]# yum repolist [root@london]# yum install ambari-server ############################## # Using Ambari user for MySQL ################################### 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'; CREATE USER 'ambari'@'london.hadoop.com' IDENTIFIED BY 'ambari'; GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'london.hadoop.com'; FLUSH PRIVILEGES; ##################################################3 # Create the Ambari DB as user Ambari ################################################### mysql -u ambari -p CREATE DATABASE ambari; USE ambari; SOURCE /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql; ################################################## # Hive user setup ################################################## # mysql -u root -pwelcome1 CREATE USER 'hive'@'localhost' IDENTIFIED BY 'hive'; GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost'; grant ALL on hive.* to 'hive'@'localhost'; CREATE USER 'hive'@'%' IDENTIFIED BY 'hive'; GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%'; CREATE USER 'hive'@'london.hadoop.com'IDENTIFIED BY 'hive'; GRANT ALL PRIVILEGES ON *.* TO 'hive'@'london.hadoop.com'; FLUSH PRIVILEGES; ################################################## # Create the Hive database. # The Hive database must be created before loading the Hive database schema. ################################################## # mysql -u hive -p CREATE DATABASE hive; ################################################## # Oozie user setup ################################################## # mysql -u root -p CREATE USER 'oozie'@'%' IDENTIFIED BY 'oozie'; GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%'; GRANT ALL on *.* to 'oozie'@'london.hadoop.com' identified by 'oozie'; FLUSH PRIVILEGES; ################################################## # Create the Oozie database. # The oozie database must be created before loading the oozie database schema. ################################################## # mysql -u oozie -p CREATE DATABASE oozie; ################################################## # Ambari setup ################################################## ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar ################################################## # Stop /start and restart Mysql server ################################################## [root@london]# init 6 [root@london]# service mysqld status [root@london]# service mysql start [root@london]# service mysql stop [root@london]# service mysql restart ################################################## # Setup ambari-server for Mysql database. ################################################## [root@london]# ambari-server setup Using python /usr/bin/python Setup ambari-server Checking SELinux... SELinux status is 'enabled' SELinux mode is 'permissive' WARNING: SELinux is set to 'permissive' mode and temporarily disabled. OK to continue [y/n] (y)? y 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): 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. Do you accept the Oracle Binary Code License Agreement [y/n] (y)? Downloading JDK from http://public-repo-1.hortonworks.com/ARTIFACTS/jdk-8u77-linux-x64.tar.gz to /var/lib/ambari-server/resources/jdk-8u77-linux-x64.tar.gz jdk-8u77-linux-x64.tar.gz... 100% (173.0 MB of 173.0 MB) Successfully downloaded JDK distribution to /var/lib/ambari-server/resources/jdk-8u77-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)? Extracting system views... ambari-admin-2.4.1.0.22.jar ........... Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully. ################################################## # Start the ambari server ################################################## [root@london system]# 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... No errors were found. Ambari database consistency check finished 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 Waiting for server start.................... Ambari Server 'start' completed successfully.