/cp rfv mnt opt centos报错
发布网友
发布时间:2022-04-30 15:07
我来回答
共1个回答
热心网友
时间:2022-06-25 23:05
关闭防火墙和selinux 和主机映射(须双节点都操作)
#compute
[root@compute ~]# setenforce 0
[root@compute ~]# getenforce
Permissive
[root@compute ~]# systemctl stop firewalld && systemctl disable firewalld
#controller
[root@compute ~]# setenforce 0
[root@compute ~]# getenforce
Permissive
[root@compute ~]# systemctl stop firewalld && systemctl disable firewalld
#主机映射(这里就放一个节点的示例)
[root@controller ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168..10 controller
192.168..20 compute
配置yum(我所配置的是http服务yum,如果配置ftp服务的可以参考其他作者文章)
#controller
[root@controller ~]# mv /etc/yum.repos.d/* /home/
[root@controller ~]# mkdir /opt/centos
[root@controller ~]# mkdir /opt/openstack
[root@controller ~]# vi /etc/yum.repos.d/http.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=file:///opt/openstack/iaas-repo
gpgcheck=0
enabled=1
上传1804文件和iaas文件到controller /root/下
[root@controller ~]# ll
total 8075368
-rw-------. 1 root root 1836 Dec 15 14:45 anaconda-ks.cfg
-rw-r–r--. 1 root root 4470079488 Oct 30 03:57 CentOS-7-x86_64-DVD-1804.iso
-rw-r–r--. 1 root root 3799093248 Oct 30 11:18 chinaskills_cloud_iaas.iso
将centos文件挂载到/opt/centos下,iaas文件挂载到/opt/openstack下
[root@controller ~]# mount -o loop CentOS-7-x86_64-DVD-1804.iso /opt/centos/
mount: /dev/loop0 is write-protected, mounting read-only
[root@controller ~]# mount -o loop chinaskills_cloud_iaas.iso /opt/openstack/
mount: /dev/loop1 is write-protected, mounting read-only
检查yum源
[root@controller ~]# yum clean all && yum repolist
安装http服务并在http默认文件中创建centos和openstack文件
[root@controller ~]# yum install -y httpd
[root@controller ~]# mkdir /var/www/html/centos
[root@controller ~]# mkdir /var/www/html/openstack
将挂载的文件cp到http默认访问目录的文件中
centos文件
[root@controller ~]#cp -rfv /opt/centos/* /var/www/html/centos/
iaas文件
[root@controller ~]#cp -rfv /opt/openstack/* /var/www/html/openstack/
开启http服务
[root@controller ~]# systemctl start httpd && systemctl enable httpd
将controller节点http.repo文件改为http主机名地址
配置compute节点yum
#compute
[root@compute ~]# cat /etc/yum.repos.d/http.repo
[centos]
name=centos
baseurl=http://controller/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=http://controller/openstack/iaas-repo
gpgcheck=0
enabled=1
检查yum源
[root@controller ~]# yum clean all && yum repolist
#compute分两块空分区 作为swift和cinder的分区
[root@compute ~]# lsblk -l
[root@compute ~]# fdisk /dev/sda
n 建立新分区
p primary分区
w 写入
[root@compute ~]# lsblk -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1.8T 0 disk
sda1 8:1 0 1G 0 part /boot
sda2 8:2 0 857.9G 0 part
centos-root 253:0 0 350G 0 lvm /
centos-swap 253:1 0 7.9G 0 lvm [SWAP]
centos-home 253:2 0 500G 0 lvm /home
sda3 8:3 0 100G 0 part
sda4 8:4 0 100G 0 part
双节点安装iaas-xiandian包(注意配置不能出错,出错后面可能有很多问题)
[root@controller ~]# yum install -y iaas-xiandian
[root@compute ~]# yum install -y iaas-xiandian
修改openrc.conf文件
INTERFACE_IP= ## 在那个节点就配置那个节点的IP
INTERFACE_NAME= ## *卡 第二张网卡
##依据实际分区填写配置
BLOCK_DISK=sda3
OBJECT_DISK=sda4
接下来就是跑脚本完成openstack搭建
#controller和compute
iaas-pre-host.sh
跑完此脚本ctrl+D 重新连接即可
#controller
iaas-instack-mysql.sh && iaas-instack-keystone.sh && iaas-instack-glance.sh
#controller 和 compute
iaas-instack-nova-controller.sh && iaas-instack-neutron-controller.sh
iaas-instack-nova-compute.sh && iaas-instack-neutron-compute.sh
#controller
iaas-instack-dashboard.sh
安装完成后 http://controllerIP/dashboard 登录dashboard页面