First, the preparatory work
L Basic Tools
1) Installing Epel,epel is a project that provides high-quality software packages. First check that the host is installed:
Rpm-q Epel-release
2) If not installed, use the rpm command to install:
RPM-IVH http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
(You can also download the installation package manually)
3) After success, review the packages it is attached to:
RPM-QR Epel-release
4) Import Key:
RPM--import/etc/pki/rpm-gpg/rpm-gpg-key-epel-6
5) Install Yum-priority:
Yum Install Yum-priorities
6) in the host warehouse directory can be found Epel.repo, command:
①
cd/etc/Yum. repos.d
Ii
ls grep Epel
7) Install PDSH:
Yum Install pdsh
L Configure/etc/hosts and/etc/sysconfig/network
To modify the Hosts file under the Ambari node as an example: (Native 192.168.1.162/HADOOP03)
• Set SSH password-free login
Slightly...
L Turn off SELinux, firewalls, PackageKit
1) Turn off SELinux
① temporarily closed:
0
② permanently closed:
VI /etc/selinux/config
, set the SELINUX in which: selinux=disabled
2) Turn off the firewall:
Chkconfig iptables off
3) Close PackageKit:
vi /etc/yum/pluginconf.d/refresh-packagekit.conf
, set enabled to 02, install
L Download Ambari Warehouse
1) Enter the YUM.REPOS.D Warehouse directory:
cd/etc/Yum. repos.d
2) Download the resource manifest file for the Ambari warehouse:
wget http://Public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.6.1/ambari.repo
L Mounting Epel Repository
1) Install Epel:
Yum Install Epel-release
2) to see if the configuration is successful, command:
Yum repolist
, if successful, it should appear as follows:
L Install Ambari with Yum and also install PostgreSQL.
installation command:
Yum Install Ambari-server
L Configuration Ambari-server
Execute command:
Ambari-server Setup
, if you have not turned off SELinux, you will be prompted during the execution of this command, select Y. PostgreSQL is then configured to automatically download the installation jdk by selecting Y. After configuring the database, select n Use the default database username Ambari-server and password bigdata, select Y to create the user name password yourself. Third, start
L Start Ambari
1) Execute the command:
Ambari-server start
Starting the service, the following page appears to indicate successful startup:
Note: If you are installing Ambari with a common user such as Hadoop, and the database is MySQL, the startup error will be the solution:
① creating a user in MySQL
' Admin '@'hadoop05' identified by ' admin '
;
Create the Ambari database.
② with Admin user login MySQL,
Use Ambari
; then
Source/var/lib/ambari-server/resources/ambari-ddl-mysql-create.sql
,
Import the Ambari SQL script.
2) Enter "host ip:8080" in the browser to enter the login interface, the default user name password is admin/admin.
Note here that the prerequisite is that the httpd must be installed and the HTTPD service is started:
① to see if the installation:
grep httpd
, if not, install the command:
Yum Install httpd
② Modify the configuration file:
VI /etc/httpd/conf/httpd.conf
As follows:
③ Restart the host:
Shutdown-r now
, and when the boot is complete, start the HTTPD service:
Servie httpd Start
3) Related configuration commands for Ambari
① Modify the port number:
VI /etc/ambari-server/conf/ambari.properties
, add Client.api.port=<port_number> to the file, and the native port_number is modified to 8888.
② Viewing the Ambari process:
PS grep Ambari
③ Stop Ambari Process:
Ambari-server stop
④ Restart the Ambari process:
Ambari-server restart
Four, disk expansion
Problem Introduction: When the subsequent Mr Job executes, an error similar to "Insufficient disk space" is reported because the disk capacity of the directory where the Ambari installation resides is insufficient.
Solution: Since Ambari is installed, an LVM logical volume is created for the temporary file storage generated by Hadoop operations, as follows:
Therefore, we only need to expand the vg_hadoop01. The operation is as follows:
1) 1 represents the information for the first partition, which has been filled with Hadoop, and 2 represents the information for the second partition, which is the partition we need to expand to VG_HADOOP01. As follows:
2) The/DEV/SDB5 sub-block (note that the ID must be 8e,system must be Linux LVM) is assigned to VG_HADOOP01.
Setup commands for ①8e and Linux LVM:
Fdisk/dev/sdb
, then press m, set according to the prompts.
② input command: partprobe, let the partition table take effect.
③ because the file type of LVM is EXT4, the new partition must be formatted as EXT4.
Format command:
Mkfs–t EXT4/DEV/SDB5
.
④ Create PV (physical volume), command:
Pvcreate/dev/sdb5
, using: Pvdisplay view:
⑤ expansion LVM, command:
Vgextend VG_HADOOP01/DEV/SDB5
, using: Vgdisplay view:
⑥ extends the capacity in LVM to the LV (logical volume) command:
Lvextend–l 100g/dev/vg_hadoop01/lv_root
, expand the capacity of the partition/dev/vg_hadoop01/lv_root to 100G. Use Lvdisplay to view:
3) Perform the reset size, which is valid for the/dev/vg_hadoop01/lv_root currently in use. Command:
Resize2fs/dev/vg_hadoop01/lv_root
To view the Mount status after expansion: DF-LHT.
Ambari Installation Guide