软件版本
- ambari 2.7.5
- HDP 3.1.5
- centos7.9
设置静态IP
静态IP设置很简单,修改网络配置文件
vim /etc/sysconfig/network-scripts/ifcfg-ens33
配置如下
BOOTPROTO="static"
ONBOOT="yes"
IPADDR=192.168.1.21
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.1
每台机器均修改为静态IP
添加hosts文件
vim /etc/host
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.21 hadoop1
192.168.1.22 hadoop2
192.168.1.23 hadoop3
配置免密并拷贝hosts文件
主节点访问子节点需要免密,使用命令生成密钥,并拷贝到子节点,主节点为hadoop1
ssh-keygen
ssh-copy-id
关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
or
service firewalld stop
chkconfig firewalld off
关闭selinux
vim /etc/selinux/config
SELINUX=disabled
同步配置文件
scp /etc/hosts hadoop2:/etc/hosts
scp /etc/selinux/config hadoop2:/etc/selinux/config
scp /etc/hosts hadoop3:/etc/hosts
scp /etc/selinux/config hadoop3:/etc/selinux/config
挂载磁盘
[root@hadoop3 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x6b24e51e.
Command (m for help): p
Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x6b24e51e
Device Boot Start End Blocks Id System
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-209715199, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@hadoop3 ~]# mkfs.xfs /dev/sdb1
meta-data=/dev/sdb1 isize=512 agcount=4, agsize=6553536 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=26214144, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=12799, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@hadoop3 ~]# mkdir /data01
[root@hadoop3 ~]# mount /dev/sdb1 /data01
[root@hadoop3 ~]# vi /etc/fstab
[root@hadoop3 ~]#
/dev/sdb1 /data01 xfs defaults 0 0
网络增强配置
如果是物理机,交换机插槽较多,可以配置bond6使用双网口进行访问,加快网络的吞吐。bond6配置后续有空会展开来描述。
总结
操作系统初始配置到此结束,后续进行安装前的yum配置。