一.1.1.1基础环境配置
使用提供的用户名密码,登录提供的公有云平台,使用CentOs7.9镜像,创建两台云主机,自行选择云主机类型,自行检查安全组策略,以确保网络正常通信与ssh连接,然后按以下要求配置服务器:
(1)设置控制节点主机名为controller,设置计算节点主机名为compute;
(2)修改hosts文件将IP地址映射为主机名;
(3)配置ssh免密通信;
(4)在compute节点使用fdisk分出3个50G的空白分区,供后续组件使用;
#答案←
[root@controller ~]# hostnamectl set-hostname controller
[root@compute ~]# hostnamectl set-hostname compute
[root@controller ~]# vim /etc/hosts
10.0.3.175 controller
10.0.3.158 compute
[root@compute ~]# vim /etc/hosts
10.0.3.175 controller
10.0.3.158 compute
[root@controller ~]#ssh-copy-id controller
[root@compute ~]# ssh-copy-id compute
返回
[root@controller ~]# hostnamectl && cat /etc/hosts && cat /root/.ssh/known_hosts
Static hostname: controller
Icon name: computer-vm
Chassis: vm
Machine ID: cc2c86fe566741e6a2ff6d399c5d5daa
Boot ID: 5dedd995f0bc42058617f32eb2ea092b
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.el7.x86_64
Architecture: x86-64
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.100.202 controller
192.168.100.138 compute
compute,192.168.100.138 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMFdTArsUcaJzprbgTA1kM/GvqgXs647jGy6z3z+fbUrikCCYjKQmCYw0dvLy+H6hzHu1zRJR82tHGoK2kIUm4g=
controller,192.168.100.202 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBZdg0e6POq0578Jan4WaRqbayzLaBxu8+sikBppBL1nYAsrWtusAXM+VMTsdNIkIZRQ18h7aeXsve7ixPizDCg=
- 点赞
- 收藏
- 关注作者
评论(0)