1先解決最小化ip問題
http://www.reibang.com/p/2d54949165a9
2設(shè)置機器名
vi /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=hadoop01
3設(shè)置Host文件
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.91.128 hadoop01
4關(guān)閉防火墻(所有節(jié)點)
檢查防火墻的狀態(tài):
從centos7開始使用systemctl來管理服務(wù)和程序谭胚,包括了service和chkconfig第步。
[root@localhost ~]#systemctl list-unit-files|grep firewalld.service
--防火墻處于關(guān)閉狀態(tài)
firewalld.service disabled
關(guān)閉防火墻:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機啟動
關(guān)閉SElinux(所有節(jié)點) :
1.使用getenforce命令查看是否關(guān)閉
如果屏幕輸出Enforcing祥绞,則表示SElinux為開啟狀態(tài)荐类。
2.修改/etc/selinux/config 文件
將SELINUX=enforcing改為SELINUX=disabled禽笑,執(zhí)行該命令后重啟機器生效
配置NTP服務(wù)(所有節(jié)點)
如果您正在使用NTPD 同步你的主機時鐘,但是 chronyd 也正在運行臀玄,Cloudera Manager依賴 chronyd驗證時間同步尽纽,即使它沒有正確同步。這可能導(dǎo)致Cloudera Manager報告 時鐘偏移錯誤乃坤,即使時間正確苛让。
要解決此問題,請配置和使用 chronyd 或禁用它并從主機中刪除它湿诊。
systemctl disable chronyd 徹底禁用chrony服務(wù)
systemctl stop chronyd 停止chrony服務(wù)
使用 NTPD 時間同步:
Install the ntp package:
yum install ntp -y
Edit the /etc/ntp.conf
file to add NTP servers, as in the following example.
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
Start the ntpd
service:
sudo systemctl start ntpd
Configure the ntpd
service to run at boot:
sudo systemctl enable ntpd
Synchronize the system clock to the NTP server:
ntpdate -u 0.pool.ntp.org
Synchronize the hardware clock to the system clock:
hwclock --systohc
5安裝JDK1.8
http://www.reibang.com/p/456041b488c9
6安裝MySQL
http://www.reibang.com/p/1c41ce3e9305
7克隆出新節(jié)點狱杰,并且ssh免密發(fā)送秘鑰
設(shè)置SSH無密碼登錄
Hadoop集群中的各個機器間會相互地通過SSH訪問,每次訪問都輸入密碼是不現(xiàn)實的厅须,所以要配置各個機器間的SSH是無密碼登錄的仿畸。
1、 在hadoop01上生成公鑰
[root@hadoop01 ~]# ssh-keygen -t rsa
一路回車朗和,都設(shè)置為默認(rèn)值错沽,然后再當(dāng)前用戶的Home目錄下的.ssh目錄中會生成公鑰文件(id_rsa.pub)和私鑰文件(id_rsa)。
2眶拉、 分發(fā)公鑰
yum -y install openssh-server openssh-clients
[root@hadoop01 ~] ssh-copy-id hadoop01
[root@hadoop01 ~] ssh-copy-id hadoop02
[root@hadoop01 ~] ssh-copy-id hadoop03
3千埃、 設(shè)置hadoop02、hadoop03到其他機器的無密鑰登錄
同樣的在hadoop02忆植、hadoop03上生成公鑰和私鑰后放可,將公鑰分發(fā)到三臺機器上。
部分功能
添加域名解析
在/etc/resolv.conf添加:
nameserver 114.114.114.114
nameserver 8.8.8.8
nameserver 8.8.4.4
然后執(zhí)行
chattr +i /etc/resolv.conf
配置epel源
在root用戶下執(zhí)行下面命令:
rpm -ivh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum repolist
安裝常用工具
yum install wget vim gcc zip unzip -y
配置最大文件打開數(shù)
在root用戶下執(zhí)行下面命令:
echo ulimit -n 65536 >> /etc/profile
source /etc/profile
ulimit -n
vim /etc/security/limits.conf
在文件尾部添加如下代碼:
* soft nofile 65536
* hard nofile 65536
重啟系統(tǒng)朝刊,在任何用戶下查看最大打開文件數(shù):ulimit -n 結(jié)果都是65536
更新系統(tǒng)
yum update