環(huán)境與配置
- centos8
- hadoop 3.3.5
安裝步驟
- 創(chuàng)建一個虛擬機,克隆三個虛擬機,master內(nèi)存改大一點4G,salve內(nèi)存1Gj
修改主機名和配置靜態(tài)ip(管理員模式下)(主從機器都要修改)
hostnamectl set-hostname node1 # 修改主機名
sudo passwd root #設置root密碼
yum install -y net-tools #安裝網(wǎng)絡服務
yum install openssh-server -y # 安裝ssh服務
vim /etc/sysconfig/network-scripts # 編輯路徑下的ens文件
#直接用下面內(nèi)容覆蓋
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=eui64
NAME=ens160
UUID=41268e0c-948b-445f-b196-3e9b63a85905
DEVICE=ens160
ONBOOT=yes
IPADDR=192.168.37.140 # 需要改
NETMASK=255.255.255.0
GATEWAY=192.168.37.2 #需要改
DNS1=8.8.8.8
nmcli c reload(重啟網(wǎng)絡服務)
init 6 # 重啟
參考鏈接:
https://blog.csdn.net/alfiy/article/details/122279914文章來源:http://www.zghlxwxcb.cn/news/detail-475359.html
修改windows的hosts和linux的host(主從機器都要配置)
vim /etc/hosts # 修改主機映射
# 用下面的內(nèi)容覆蓋
192.168.37.140 master
192.168.37.141 node1
192.168.37.142 node2
192.168.37.143 node3
設置ssh免密登錄,((主從機器都要配置))
#編寫一個sync_ssh.sh文件,填入下面的內(nèi)容
#生成ssh私鑰
ssh-keygen -f /root/.ssh/id_rsa -N ''
#循環(huán)把公鑰傳遞到服務器上,免密登錄
for i in node1 node2 node3 master
do
ssh-copy-id $i
done
如果報錯 Permission denied (publickey,password)
報錯參考:
https://blog.csdn.net/weixin_41891385/article/details/118631106
文章來源地址http://www.zghlxwxcb.cn/news/detail-475359.html
關閉防火墻/Selinux
# 關閉防火墻
systemctl stop firewalld.service;systemctl disable firewalld.service
# 關閉selinux
vi /etc/selinux/config # 覆蓋一下內(nèi)容
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
把時間同步成上海時間(主從機器都要)
#從倉庫中直接安裝
dnf install chrony -y
#啟動chrony
systemctl start chronyd.service && systemctl enable chronyd.service
#設置時區(qū) (這步很重要,把時區(qū)改成當?shù)貢r區(qū))
timedatectl set-timezone "Asia/Shanghai"
#編輯配置文件(使系統(tǒng)同步阿里云的時間)
vi /etc/chrony.conf 修改下方內(nèi)容
#Use public servers from the pool.ntp.org project.
#Please consider joining the pool (http://www.pool.ntp.org/join.html).
#pool 2.centos.pool.ntp.org iburst 注釋掉
server ntp.aliyun.com iburst 新增行
server cn.ntp.org.cn iburst 新增行
#重啟服務
systemctl restart chronyd.service
#執(zhí)行時間同步命令
chronyc sources -v
#查看當前系統(tǒng)時間
date
到了這里,關于hadoop環(huán)境配置及HDFS配置的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!