一、 安装前的准备
软硬件需求:
项目 |
指标 |
os |
red hat6.5.x86_64 |
java |
1.8.0_101 |
ambari |
AMBARI-2.2.1.0 |
HDP |
HDP2.4.0.0 |
HDP-UTILS |
HDP-UTILS-1.1.0.20 |
openssl |
openssl-1.0.1e-16.el6.x86_64 orlater |
firewall |
关闭 |
selinux |
disabled |
ntpd |
时钟同步 |
python |
v2.6 or later |
修改网络:
[root@master ~]
DEVICE=eth0
HWADDR=00:0C:29:62:85:30
TYPE=Ethernet
UUID=c0202d5d-edd3-4058-88ca-e0194131f6ce
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR="192.168.1.221"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
[root@master ~]
修改/etc/hosts
:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.221 master
修改主机名:
[root@master ~]
NETWORKING=yes
HOSTNAME=master
[root@master ~]
master
[root@master ~]
1.1java环境变量
以root权限, 在所有服务器上执行操作
1.1.1、删除openjkdk:
rpm -qa |grep openjdk |xargs -i yum -y remove {}
1.1.2、
cd /var/www/html/
tar -zxvf jdk-8u101-linux-x64.tar.gz
mv jdk1.8.0_101/ java
mv java /usr/
vi /etc/profile
export JAVA_HOME=/usr/java/
export JAVA_BIN=$JAVA_HOME/bin
export PATH=$PATH:$JAVA_BIN
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile
java -version 查看是否是安装的版本
查询如下:
[root@master html]
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
[root@master html]
1.2 防火墙配置:
建议将防火墙关闭, 以root权限(在所有服务器上执行操作)
--
1.3、关闭SELinux
以root权限(在所有服务器上执行操作)
临时关闭:
长久关闭:编辑/etc/sysconfig/selinux;修改SELINUX=disabled
1.4NTP服务器配置
以root权限, (在所有服务器上执行操作)
在log16上配置ntp服务器,其他服务器跟log16同步
配置方法:
Log16:修改/etc/ntp.conf
###############
server 127.127.1.0 minpoll 4 maxpoll 5
fudge 127.127.1.0 stratum 2
restrict 127.0.0.1
driftfile /var/lib/ntp/drift
################
置空/etc/ntp目录下的ntpservers文件;
修改/etc/ntp目录下的step-tickers文件如下:127.127.1.0
#service ntpd restart //重启ntp服务
其他log节点服务器,修改/etc/ntp.conf
################
server 10.180.91.16 minpoll 4 maxpoll 5
fudge 127.127.1.0 stratum 3
restrict 127.0.0.1
driftfile /var/lib/ntp/drift
logfile /var/log/ntp.log
restrict 10.180.91.16 mask 255.255.255.255
#################
置空/etc/ntp目录下的ntpservers文件;
修改/etc/ntp目录下的step-tickers文件如下:10.180.91.16
其他的服务器上启动ntpd服务,依次执行
#service ntpd start //其他sever执行同样操作
1.5、OS层参数
HBase在运行时需要操作的open files数超过默认值,一般是1024 ,最大可以设置为:65536。
配置修改:对集群内所有机器进行如下配置修改:
vi /etc/security/limits.conf
#然后添加如下参数:
* soft nproc 65536
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536
hbase soft nproc 65536
habse hard nproc 65536
hadoop - nofile 32768
hadoop - nproc 32000
#Swappiness设置
vi /etc/sysctl.conf
#在本配置中加上如下项:
vm.swappiness=0
fs.file-max = 65536
#在配置进行如下修改:/boot/grub/grub.conf
#在“module /vmlinuz-2.6.32-279.el6.x86_64 ro root=UUID=780ce319-0a35-44c6-be6d-4593c261537c intel_iommu=on rd_NO_LUKS KE
YBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=128M LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet”这一行最后加上“elevator=deadline”
修改完之后是:
module /vmlinuz-2.6.32-279.el6.x86_64 ro root=UUID=780ce319-0a35-44c6-be6d-4593c261537c intel_iommu=on rd_NO_LUKS KE
YBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=128M LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet elevator=deadline
然后重启系统。
1.6 创建chbHadoop用户及组
chbHadoop用户用于安装hadoop集群相关软件
groupadd chbHadoop
useradd -d /home/chbHadoop/ -g chbHadoop -s /bin/bash chbHadoop
passwd chbHadoop
123@hadoop
1.7 配置ssh证书认证
由于HDP安装需要openssl-1.0.1e-16.el6.x86_64
or later ,而默认为:
[root@master yum.repos.d]# rpm -qa |grep openssl
openssl-1.0.1e-15.el6.x86_64
[root@master yum.repos.d]#
所以需要更新openssl,
删除旧的:
rpm -qa |grep openssl |xargs -i yum -y remove {}
#做好yum源
#更新openssl
yum upgrade openssl
#更新之后:
由于red hat6.5yum源, 需要注册, 我临时做了一个163的yum源,用于更新openssl, 下面为源文件:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-6 - Base - 163.com
baseurl=http:
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http:
#released updates
[updates]
name=CentOS-6 - Updates - 163.com
baseurl=http:
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http:
#additional packages that may be useful
[extras]
name=CentOS-6 - Extras - 163.com
baseurl=http:
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http:
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - Plus - 163.com
baseurl=http:
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http:
#contrib - packages by Centos Users
[contrib]
name=CentOS-6 - Contrib - 163.com
baseurl=http:
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http:
开始配置ssh 认证(只在master执行):
以uarhadoop在master上执行
至此,第一章 前期准备工作完成。
==========================================