首页 技术 正文
技术 2022年11月21日
0 收藏 948 点赞 2,594 浏览 2880 个字

安装

https://blog.csdn.net/babyxue/article/details/80970526

主机环境预设

更换国内yum源 epel源

https://www.cnblogs.com/hanbowen/p/11563388.html

设置时间同步

https://www.cnblogs.com/hanbowen/p/11563757.html

yum install -y chrony

systemctl start chronyd

systemctl status chronyd

配置静态ip

vim /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

BOOTPROTO=static   #启用静态IP地址

DEFROUTE=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=ens33

UUID=6c6759a1-38b9-4421-b06b-aa4d783ea247

DEVICE=ens33

ONBOOT=yes   #开启自动启用网络连接

IPADDR=192.168.199.200  #设置IP地址

GATEWAY=192.168.199.1   #设置网关

NETMASK=255.255.255.0  #设置子网掩码

# PREFIXO0=24                               #二选一 设置子网掩码

DNS1=114.114.114.114  #设置主DNS

DNS2=8.8.8.8                                #设置备DNS

:wq!                                                 #保存退出

service network restart                    #重启网络

ping www.baidu.com                       #测试网络是否正常

关闭防火墙 firewalld  iptables

systemctl status firewalld

systemctl stop firewalld # 临时关闭防火墙

systemctl disable firewalld # 禁止开机启动

[root@localhost ~]# systemctl status firewalld
● firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2019-08-25 00:05:51 CST; 11h ago
Docs: man:firewalld(1)
Main PID: 593 (firewalld)
CGroup: /system.slice/firewalld.service
└─593 /usr/bin/python -Es /usr/sbin/firewalld –nofork –nopid
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl status firewalld
● firewalld.service – firewalld – dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2019-08-25 11:39:50 CST; 2s ago
Docs: man:firewalld(1)
Process: 593 ExecStart=/usr/sbin/firewalld –nofork –nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 593 (code=exited, status=0/SUCCESS)

systemctl disable firewalld

[root@localhost ~]# systemctl status iptables
Unit iptables.service could not be found.

重启网络服务

service network restart

生成密钥传到各个节点去 让他们可以互相连接

[root@master ~]# ssh-keygen -t rsa -C “hbw1992@sina.com”

[root@master ~]# cd .ssh/

[root@master .ssh]# ll

total 12

-rw——-  1 root root 1679 Aug 25 12:36 id_rsa

-rw-r–r–  1 root root  398 Aug 25 12:36 id_rsa.pub

-rw-r–r–. 1 root root  191 Aug 19 22:03 known_hosts

cat id_rsa.pub

[root@master .ssh]# vi .ssh/authorized_keys

把id_rsa.pub加进去

[root@master ~]# scp -r /root/.ssh node1:/root/

配置hosts

vi /etc/hosts

192.168.199.200 master1.hbw.com master1

192.168.199.201 node1.hbw.com node1

192.168.199.202 node2.hbw.com node2

192.168.116.203 node3.hbw.com node3

scp /etc/hosts node1:/etc/hosts

reboot #重启系统

设置主机名为master1.hbw.com(配置hosts了不用做这步)

hostname  master1.hbw.com                      #设置主机名为master1.hbw.com

vi /etc/hostname                     #编辑配置文件

master1.hbw.com                                        #修改localhost.localdomain为master1.hbw.com

:wq!                                        #保存退出

vi /etc/hosts                           #编辑配置文件

127.0.0.1 localhost master1.hbw.com       #修改localhost.localdomain为master1.hbw.com

:wq!                                        #保存退出

shutdown -r now                    #重启系统

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,104
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,581
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,428
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,200
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,835
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,918