虚拟机集群配置
-
MacOS安装VBox

-
在工具选项内创建网络
- 手动配置网卡
-
安装虚拟机
-
虚拟机网络配置
-
网卡1选择NAT网络模式,界面模式选择NatNetwork
-
网卡2选择仅主机(host-only)网络,界面名称选择vboxnet0
-
修改虚拟机内网卡配置文件
-
cd /etc/sysconfig/network-scripts/ -
修改ifcfg-enp0s3文件
ONBOOT=yes -
修改ifcfg-enp0s8文件,设置为固定IP
BOOTPROTO=static ONBOOT=yes IPADDR=192.168.56.101 NETMASK=255.255.255.0 -
克隆服务器之后,需要修改ifcfg-enp0s8文件中的uuid和ipaddr
-
重启网络,
service network restart
-
-
-
修改服务器yum源
-
安装wget
yum install -y wget -
更换为国内yum源
cd /etc/yum.repos.d/ mv CentOS-Base.repo CentOS-Base.repo.bak wget -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum clean all yum makecache yum update yum install net-tools.x86_64 yum install ntpd -
设置主机名
hostnamectl set-hostname node-01 -
修改hosts文件,使用域名访问
vim /etc/hosts node-01 192.168.0.100 node-02 192.168.0.101 node-03 192.168.0.103
-
-
同步时间
ntpd https://aliyun.com -
关闭防火墙
# 关闭防火墙 systemctl stop firewalld # 禁止开机自启动 systemctl disable firewalld -
服务器免密
ssh-keygen # 生成秘钥 # 将pub秘钥上传到其他的服务器(互相上传) ssh-copy-id .ssh/id_rsa.pub node-02 -
部署java环境
tar -zxvf jdk_1_8_0.tar.gz # 修改配置文件,/etc/profile export JAVA_HOME=/opt/software/jdk_1_8_0/ export $CLASSPATH=/opt/software/jdk_1_8_0/jre export PATH=$PATH:$JAVA_HOME/bin:$CLASSPATH # 加载配置文件 source /etc/profile
965

被折叠的 条评论
为什么被折叠?



