程序猿小碼農 2021-09-18 06:27:32 阅读数:491
IPV6_FAILURE_FATAL=no
NAME=eno16777728
UUID=33c092da-748f-4504-b735-d9dff2a49d33
DEVICE=eno16777728
ONBOOT=yes
IPADDR=192.168.1.20
PREFIX=24
[[email protected] ~]# cd /etc/sysconfig/network-scripts/
[[email protected] network-scripts]# cp -a ifcfg-eno16777728 ifcfg-eno33554960
[[email protected] network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-eno33554960
DEVICE=eno33554960
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.2.20
PREFIX=24
[[email protected] ~]# systemctl restart network
[[email protected] ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
2: eno16777728: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
3: eno33554960: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP qlen 1000
記得拉取兩個鏡像!!!(只需要在controller節點拉取)
[[email protected] yum.repos.d]# systemctl stop firewalld
[[email protected] yum.repos.d]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[[email protected] yum.repos.d]# setenforce 0
[[email protected] yum.repos.d]# vi /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
[[email protected] yum.repos.d]# systemctl stop firewalld
[[email protected] yum.repos.d]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[[email protected] yum.repos.d]# setenforce 0
[[email protected] yum.repos.d]# vi /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
配置主機名映射
[[email protected] ~]# vi /etc/hosts
192.168.1.10 controller
192.168.1.20 compute
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[[email protected] ~]# vi /etc/hosts
192.168.1.10 controller
192.168.1.20 compute
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[[email protected] ~]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# rm -rf *
[[email protected] yum.repos.d]# cat local.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=file:///opt/iaas/iaas-repo
gpgcheck=0
enabled=1
[[email protected] ~]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# rm -rf *
[[email protected] yum.repos.d]# cat local.repo
[centos]
name=centos
baseurl=ftp://controller/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://controller/iaas/iaas-repo
gpgcheck=0
enabled=1
[[email protected] ~]# ls
anaconda-ks.cfg CentOS-7-x86_64-DVD-1511.iso XianDian-IaaS-v2.2.iso
[[email protected] ~]# mkdir /opt/centos
[[email protected] ~]# mkdir /opt/iaas
[[email protected] ~]# cat /etc/fstab
UUID=36615874-b25f-4539-b376-8a5c387c0212 / xfs defaults 0 0
UUID=02223747-779a-4b6d-a300-2774ec29a144 /boot xfs defaults 0 0
UUID=01956b4a-500a-4f23-8b60-75b3bb457ded swap swap defaults 0 0
/root/CentOS-7-x86_64-DVD-1511.iso /opt/centos iso9660 defaults 0 0
/root/XianDian-IaaS-v2.2.iso /opt/iaas iso9660 defaults 0 0
[[email protected] ~]# mount -a
mount: /dev/loop0 is write-protected, mounting read-only
mount: /dev/loop1 is write-protected, mounting read-only
[[email protected] ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 98G 7.6G 90G 8% /
devtmpfs 904M 0 904M 0% /dev
tmpfs 913M 0 913M 0% /dev/shm
tmpfs 913M 8.5M 904M 1% /run
tmpfs 913M 0 913M 0% /sys/fs/cgroup
/dev/sda1 497M 118M 380M 24% /boot
tmpfs 183M 0 183M 0% /run/user/0
/dev/loop0 4.1G 4.1G 0 100% /opt/centos
/dev/loop1 2.7G 2.7G 0 100% /opt/iaas
[[email protected] ~]# yum list
[[email protected] ~]# yum install -y vim
[[email protected] ~]# yum install -y vsftpd
[[email protected] ~]# cat /etc/vsftpd/vsftpd.conf (在第一行添加下面內容,點點不用寫)
anon_root=/opt/
…
…
[[email protected] ~]# systemctl restart vsftpd
[[email protected] ~]# systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
[[email protected] ~]# yum install -y iaas-xiandian
[[email protected] ~]# yum install -y iaas-xiandian
[[email protected] ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0002f10c
Device Boot Start End Blocks Id System
/dev/sda1 2048 4196351 2097152 82 Linux swap / Solaris
/dev/sda2 * 4196352 41943039 18873344 83 Linux
Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[[email protected] ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xa5eb8d25.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First sector (2048-209715199, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199): +30G
Partition 1 of type Linux and of size 30 GiB is set
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p):
Using default response p
Partition number (2-4, default 2):
First sector (62916608-209715199, default 62916608):
Using default value 62916608
Last sector, +sectors or +size{K,M,G} (62916608-209715199, default 209715199): +30G
Partition 2 of type Linux and of size 30 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[[email protected] ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0002f10c
Device Boot Start End Blocks Id System
/dev/sda1 2048 4196351 2097152 82 Linux swap / Solaris
/dev/sda2 * 4196352 41943039 18873344 83 Linux
Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa5eb8d25
Device Boot Start End Blocks Id System
/dev/sdb1 2048 62916607 31457280 83 Linux
/dev/sdb2 62916608 125831167 31457280 83 Linux
[[email protected] ~]# mkfs.xfs /dev/sdb1
[[email protected] ~]# mkfs.xfs /dev/sdb2
版权声明:本文为[程序猿小碼農]所创,转载请带上原文链接,感谢。 https://gsmany.com/2021/09/20210918062732066n.html