环境安装-Centos7.4安装及配置

环境安装-Centos7.4安装及配置

〇、资料汇总

一、虚拟机安装

1、下载地址

https://pan.baidu.com/s/1zcOp06HX4OxPdsCCGkHbXQ

提取码:7777

2、安装步骤

https://mp.weixin.qq.com/s/36OhAiYvAmKVGd-QQ26dWg

二、Centos安装

1、安装步骤(CentOS7.4)

https://blog.csdn.net/qq_42818882/article/details/123580237

三、配置ip、host映射与主机名

1、配置ip与dns

https://blog.csdn.net/qq_42141141/article/details/126440519

2、配置host映射

https://www.itbiancheng.com/article/5616.html

3、配置主机名

(1)简单命令方式:

https://blog.csdn.net/realoser/article/details/123392781

(2)修改配置文件方式

设置主机名:cd /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=hadoop01

service network restart

四、关闭防火墙及selinux

1、关闭防火墙

参考地址:https://blog.csdn.net/qq_38173650/article/details/120344471

(1)iptables

【不适用】

service iptables stop

chkconfig iptables off

(2)firewalld☆

【适合用】

启动: systemctl start firewalld
查看状态: systemctl status firewalld
禁用,禁止开机启动: systemctl disable firewalld
停止运行: systemctl stop firewalld
重启:firewall-cmd --reload

2、关闭selinux

https://blog.csdn.net/weixin_55597816/article/details/122888166

五、开启时钟同步

1、ntpd方式☆

yum install ntpd -y

service ntpd start

chkconfih ntpd on

六、设置SSH免密登录

1、最简单方式☆

https://blog.csdn.net/weixin_53742691/article/details/126272727

2、复杂命令方式

(1)本地

ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

(2)远程

ssh-copy-id -i .ssh/id_rsa.pub root@hadoop02

七、jdk安装与测试

1、下载

地址:Oracle官网

jdk_1.8.npm

2、安装

npm -i jdk_1.8.npm

ll查看安装路径(软链接),默认安装在/usr/java/default

3、配置环境变量

vi /etc/profile

添加

export JAVA_HOME=/usr/java/default

export PATH=$PATH:$JAVA_HOME/bin

生效:source /etc/profile

4、验证

java -version

八、机器克隆后修改

1、修改ip与dns

https://blog.csdn.net/qq_42141141/article/details/126440519

2、修改主机名

(1)简单命令方式:

https://blog.csdn.net/realoser/article/details/123392781

(2)修改配置文件方式

设置主机名:cd /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=hadoop01

service network restart

(3)快速重启验证

reboot

3、设置ssh免密登录

参考:https://blog.csdn.net/weixin_53742691/article/details/126272727

验证:ssh root@hadoop01或直接ssh hadoop01

posted @ 2022-10-29 13:14  哥们要飞  阅读(192)  评论(0编辑  收藏  举报