1.8 Ambari+HDP搭建hadoop(一)

總目錄:http://www.itdecent.cn/p/e406a9bc93a9

Hadoop - 子目錄:http://www.itdecent.cn/p/9428e443b7fd

Ambari+HDP簡介

虛擬機(jī)準(zhǔn)備

主機(jī)名 IP 角色 內(nèi)存 核數(shù) 磁盤
ambari.lh.com 192.168.10.190 Ambari+HDP 2G 1 20G
master.lh.com 192.168.10.191 Master 2G 1 20G
slave1.lh.com 192.168.10.192 Slave1 2G 1 20G
slave2.lh.com 192.168.10.193 Slave2 2G 1 20G

環(huán)境配置

網(wǎng)絡(luò)配置

ifcfg-ens33


其他幾個也是這樣配置。

hostname

[root@ambari ~] cat /etc/hostname
ambari.lh.com

修改主機(jī)名。

network

[root@ambari ~] cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=ambari.lh.com

配置主機(jī)名與網(wǎng)絡(luò)狀態(tài)的關(guān)系。

hosts

[root@ambari ~] cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.190 ambari.lh.com
192.168.10.191 master.lh.com
192.168.10.192 slave1.lh.com
192.168.10.193 slave2.lh.com

ip與主機(jī)名映射表。

關(guān)閉防火墻

systemctl stop firewalld.service
systemctl disable firewalld.service

服務(wù)配置

安裝NTP時間同步服務(wù)

yum install ntp ntpdate -y

安裝httpd服務(wù)

yum install httpd -y
systemctl start httpd.service
systemctl enable httpd.service
檢查http

關(guān)閉SELinux

vim /etc/selinux/config
修改SELINUX=disabled

ssh免密登錄

生成密鑰

ssh-keygen -t rsa -f ~/.ssh/id_rsa

傳輸密鑰

ssh-copy-id ambari.lh.com
ssh-copy-id master.lh.com
ssh-copy-id slave1.lh.com
ssh-copy-id slave2.lh.com

四臺互傳

[root@ambari .ssh] ssh-copy-id ambari.lh.com
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'ambari.lh.com (192.168.10.190)' can't be established.
ECDSA key fingerprint is SHA256:WHSTGFtt/3LnDgU60HxnG20y4sDogJb3ECIfA/2L3Mk.
ECDSA key fingerprint is MD5:53:ae:4a:0d:8e:55:3c:d7:17:44:c9:5b:00:67:a7:cb.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any th
at are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it 
is to install the new keysroot@ambari.lh.com's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'ambari.lh.com'"
and check to make sure that only the key(s) you wanted were added.

[root@ambari .ssh] ssh-copy-id master.lh.com
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'master.lh.com (192.168.10.191)' can't be established.
ECDSA key fingerprint is SHA256:WHSTGFtt/3LnDgU60HxnG20y4sDogJb3ECIfA/2L3Mk.
ECDSA key fingerprint is MD5:53:ae:4a:0d:8e:55:3c:d7:17:44:c9:5b:00:67:a7:cb.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any th
at are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it 
is to install the new keysroot@master.lh.com's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'master.lh.com'"
and check to make sure that only the key(s) you wanted were added.

[root@ambari .ssh] ssh-copy-id slave1.lh.com
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'slave1.lh.com (192.168.10.192)' can't be established.
ECDSA key fingerprint is SHA256:WHSTGFtt/3LnDgU60HxnG20y4sDogJb3ECIfA/2L3Mk.
ECDSA key fingerprint is MD5:53:ae:4a:0d:8e:55:3c:d7:17:44:c9:5b:00:67:a7:cb.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any th
at are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it 
is to install the new keysroot@slave1.lh.com's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'slave1.lh.com'"
and check to make sure that only the key(s) you wanted were added.

[root@ambari .ssh] ssh-copy-id slave2.lh.com
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'slave2.lh.com (192.168.10.193)' can't be established.
ECDSA key fingerprint is SHA256:WHSTGFtt/3LnDgU60HxnG20y4sDogJb3ECIfA/2L3Mk.
ECDSA key fingerprint is MD5:53:ae:4a:0d:8e:55:3c:d7:17:44:c9:5b:00:67:a7:cb.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any th
at are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it 
is to install the new keysroot@slave2.lh.com's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'slave2.lh.com'"
and check to make sure that only the key(s) you wanted were added.

jdk環(huán)境

首先創(chuàng)建放軟件的文件夾。

cd /usr
mkdir hdk

然后上傳安裝包,解壓

[root@ambari hdk] tar -zxvf jdk-1.8.tar.gz 
[root@ambari hdk] ll
總用量 155296
drwxr-xr-x. 8   10  143       255 6月  17 2014 jdk1.8.0_11
-rw-r--r--. 1 root root 159019376 4月   3 15:16 jdk-1.8.tar.gz
[root@ambari hdk] rm jdk-1.8.tar.gz 
rm:是否刪除普通文件 "jdk-1.8.tar.gz"?y
[root@ambari hdk] mv jdk1.8.0_11/ jdk8
[root@ambari hdk] ll
總用量 0
drwxr-xr-x. 8 10 143 255 6月  17 2014 jdk8

配置環(huán)境變量

vi /etc/profile

# jdk8
export JAVA_HOME=/usr/hdk/jdk8
PATH=$JAVA_HOME/bin:$PATH

export PATH

刷新環(huán)境變量

[root@ambari hdk] source /etc/profile
[root@ambari hdk] java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

把環(huán)境變量文件和jdk8目錄傳到其他節(jié)點(diǎn)上。

scp /etc/profile root@master.lh.com:/etc
scp /etc/profile root@slave1.lh.com:/etc
scp /etc/profile root@slave2.lh.com:/etc

scp -r jdk8/ root@master.lh.com:/usr/hdk
scp -r jdk8/ root@slave1.lh.com:/usr/hdk
scp -r jdk8/ root@slave2.lh.com:/usr/hdk

然后各自刷新環(huán)境變量。
這樣四個節(jié)點(diǎn)的java環(huán)境就ok了。

mysql5.6

先檢查是否已經(jīng)安裝了MySQL。

rpm -qa | grep mysql

返回空就是沒有安裝。

然后卸載mariadb數(shù)據(jù)庫,因?yàn)樵赾entos7中默認(rèn)集成mariadb數(shù)據(jù)庫。

rpm -qa|grep mariadb|xargs rpm -e --nodeps

檢查是否卸掉

rpm -qa|grep -i mariadb

接著正式安裝mysql5.6

下載

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

安裝

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum install mysql-server

設(shè)置服務(wù)

systemctl start mysqld.service #啟動 mysql
systemctl restart mysqld.service #重啟 mysql
systemctl stop mysqld.service #停止 mysql
systemctl enable mysqld.service #設(shè)置 mysql 開機(jī)啟動

設(shè)置密碼

mysql -u root

mysql> use mysql;
mysql> update user set password=PASSWORD("123456") where User='root';
mysql> flush privileges; 

設(shè)置遠(yuǎn)程訪問

mysql> use mysql
mysql> select User, Host, Password from user;

mysql> update user set host='%' where host='localhost';
mysql> delete from user where Host='ambari.gey.com';
mysql> delete from user where Host='127.0.0.1';
mysql> delete from user where Host='::1';

mysql> flush privileges;
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容