标签:das stderr openstack round 管理员 each 降级 内核 ken
环境:
manager: 192.168.122.10 4核8G LVM100G硬盘
nova1: 192.168.122.20 4核4G LVM100G硬盘
nova2: 192.168.122.21 4核4G LVM100G硬盘
虚拟公有IP池范围:192.168.122.50-192.168.122.150
本次采用kvm虚拟机部署,网络使用virio,这样网络效率会快很多。本博yum仓库是自己搭建在本地的ftp上的,时间服务器也是同步本机,本机同步阿里云服务器的,后端镜像也是自己做的对内核部分和软件部分进行了优化,制作后端盘重点XML文件中网卡一栏中Interface中千万不要保留mac address,常识问题我居然还是踩坑了。
首先我使用的我的后端盘进行复用做的这几个系统,之前系统盘是20G,所以首先是对我的磁盘进行扩容。
扩容思路:
热扩容镜像大小限制(虚拟实例正在运行,为了不关机选择热扩容)。
刷新分区大小。
扩容lvm 卷组大小。
扩容lv 逻辑卷大小。
刷新文件系统大小。
开始热扩容镜像大小。
lqh@lqh-desktop:~$ virsh blockresize --path /var/lib/libvirt/images/os-manager.qcow2 --size 100G os-manager
Block device '/var/lib/libvirt/images/os-nova1.qcow2' is resized
lqh@lqh-desktop:/$ virsh list --all
Id Name State
----------------------------------------------------
4 os-manager running
5 os-nova1 running
6 os-nova2 running
lqh@lqh-desktop:/$ virsh console 5
Connected to domain os-nova1
Escape character is ^]
Welcome to vitualhost centos7
centos7 login: root
Password:
Last login: Sat Nov 9 21:32:14 on ttyS0
[root@centos7 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 252:0 0 100G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└─vda2 252:2 0 19G 0 part
└─centos_centos7-root 253:0 0 19G 0 lvm /
[root@centos7 ~]# growpart /dev/vda 2
CHANGED: partition=2 start=2099200 old: size=39843840 end=41943040 new: size=207615967 end=209715167
[root@centos7 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 252:0 0 100G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└─vda2 252:2 0 99G 0 part
└─centos_centos7-root 253:0 0 19G 0 lvm /
[root@centos7 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos_centos7 1 1 0 wz--n- <19.00g 0
[root@centos7 ~]# pvresize /dev/vda2
Physical volume "/dev/vda2" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@centos7 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos_centos7 1 1 0 wz--n- <99.00g 80.00g
[root@centos7 ~]# lvextend -L +79.9G /dev/centos_centos7/root
Rounding size to boundary between physical extents: 79.90 GiB.
Size of logical volume centos_centos7/root changed from <19.00 GiB (4863 extents) to <98.90 GiB (25318 extents).
Logical volume centos_centos7/root successfully resized.
[root@centos7 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos_centos7 -wi-ao---- <98.90g
[root@centos7 ~]# xfs_growfs /
meta-data=/dev/mapper/centos_centos7-root isize=512 agcount=4, agsize=1244928 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=4979712, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 4979712 to 25925632
[root@centos7 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos_centos7-root 99G 1.1G 98G 2% /
devtmpfs 2.1G 0 2.1G 0% /dev
tmpfs 2.2G 0 2.2G 0% /dev/shm
tmpfs 2.2G 8.5M 2.1G 1% /run
tmpfs 2.2G 0 2.2G 0% /sys/fs/cgroup
/dev/vda1 1014M 130M 885M 13% /boot
tmpfs 278M 0 278M 0% /run/user/0
[root@centos7 ~]# hostnamectl set-hostname os-manager
[root@centos7 ~]# hostnamectl set-hostname os-nova1
[root@centos7 ~]# hostnamectl set-hostname os-nova2
[root@centos7 ~]# vim /etc/hosts
192.168.122.10 os-manager
192.168.122.20 os-nova1
192.168.122.21 os-nova2
[root@centos7 ~]# scp /etc/hosts root@os-nova1:/etc/
[root@centos7 ~]# scp /etc/hosts root@os-nova2:/etc/
[root@os-manager ~]# sed -i '/^search*/ d' /etc/resolv.conf
[root@os-manager ~]# chronyc sources -v
210 Number of sources = 1
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* gateway 3 6 377 6 -568us[ -819us] +/- 2943us
lqh@lqh-desktop:~$ df -h
文件系统 容量 已用 可用 已用% 挂载点
udev 7.8G 0 7.8G 0% /dev
tmpfs 1.6G 5.8M 1.6G 1% /run
/dev/sda5 492G 29G 438G 7% /
tmpfs 7.8G 285M 7.6G 4% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/sdb1 98M 33M 66M 33% /boot/efi
tmpfs 1.6G 60K 1.6G 1% /run/user/1000
tmpfs 1.6G 0 1.6G 0% /run/user/0
/dev/loop0 8.8G 8.8G 0 100% /srv/ftp/CentOS7-1804
/dev/loop1 169M 169M 0 100% /srv/ftp/extras
/dev/loop2 3.0G 3.0G 0 100% /srv/ftp/openstack
[root@os-manager ~]# vim /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=ftp://192.168.122.1/CentOS7-1804/
enable=1
gpgcheck=0
[local_extras]
name=local_extras
baseurl=ftp://192.168.122.1/extras/
enable=1
gpgcheck=0
[local_openstatck_rpms]
name=local_ops_rpms
baseurl=ftp://192.168.122.1/openstack/rhel-7-server-openstack-10-rpms/
enable=1
gpgcheck=0
[local_openstack_dev]
name=local_ops_dev
baseurl=ftp://192.168.122.1/openstack/rhel-7-server-openstack-10-devtools-rpms/
enable=1
gpgcheck=0
[root@os-manager ~]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
local | 3.6 kB 00:00
local_extras | 2.9 kB 00:00
local_openstack_dev | 2.9 kB 00:00
local_openstatck_rpms | 2.9 kB 00:00
(1/2): local_openstack_dev/primary_db | 3.7 kB 00:00
(2/2): local_openstatck_rpms/primary_db | 318 kB 00:00
源标识 源名称 状态
local local 9,911
local_extras local_extras 76
local_openstack_dev local_ops_dev 3
local_openstatck_rpms local_ops_rpms 680
repolist: 10,670
[root@os-manager ~]# scp /etc/yum.repos.d/local.repo root@192.168.122.20:/etc/yum.repos.d/
[root@os-manager ~]# scp /etc/yum.repos.d/local.repo root@192.168.122.21:/etc/yum.repos.d/
[root@os-manager ~]# yum install -y python-setuptools
[root@os-nova1 ~]# yum install -y qemu-kvm libvirt-client libvirt-daemon libvirt-daemon-driver-qemu python-setuptools
[root@os-nova2 ~]# yum install -y qemu-kvm libvirt-client libvirt-daemon libvirt-daemon-driver-qemu python-setuptools
[root@os-manager ~]# yum install -y openstack-packstack
Error: Package: libselinux-ruby-2.5-12.el7.x86_64 (local)
Requires: libselinux(x86-64) = 2.5-12.el7
Installed: libselinux-2.5-14.1.el7.x86_64 (@base)
libselinux(x86-64) = 2.5-14.1.el7
Available: libselinux-2.5-12.el7.x86_64 (local)
libselinux(x86-64) = 2.5-12.el7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
#因为我这边包被安装了版本较高的libselinux-2.5-14.1.el7.x86_64但是依赖包必须要是 libselinux(x86-64) = 2.5-12.el7,所以需要对安装包进行降级处理,我在ftp上找到需要的包,然后scp到/tmp目录下,对其进行降级安装操作。
root@lqh-desktop:/srv/ftp# scp CentOS7-1804/Packages/libselinux-2.5-12.el7.x86_64.rpm root@192.168.122.10:/tmp
[root@centos7 tmp]# yum downgrade libselinux-2.5-12.el7.x86_64.rpm setools-libs libselinux-python libselinux-utils libsemanage policycoreutils ...........................................
#这里看你自己有多少依赖存在问题,你就需要自己看着办我处理依赖问题是花了几分钟的。
[root@os-manager ~]# packstack --gen-answer-file=answer.ini
Packstack changed given value to required value /root/.ssh/id_rsa.pub
[root@os-manager ~]# vim answer.ini
42 CONFIG_SWIFT_INSTALL=n #关闭计费相关模块
45 CONFIG_CEILOMETER_INSTALL=n #关闭计费相关模块
49 CONFIG_AODH_INSTALL=n #关闭计费相关模块
53 CONFIG_GNOCCHI_INSTALL=n #关闭计费相关模块
75 CONFIG_NTP_SERVERS=192.168.122.1 #时间服务器地址
98 CONFIG_COMPUTE_HOSTS=192.168.122.20,192.168.122.21 #计算节点地址
102 CONFIG_NETWORK_HOSTS=192.168.122.10192.168.122.20,192.168.122.21 #加入网络管理地址
333 CONFIG_KEYSTONE_ADMIN_PW=lqh #管理员密码
840 CONFIG_NEUTRON_ML2_TYPE_DRIVERS=flat,vxlan #驱动类型
910 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex #物理网桥的名称
921 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth0 #br-ex桥的名称与eth0连接,管理eth0,网桥与哪个物理网卡连接
1179 CONFIG_PROVISION_DEMO=n #是否安装DEMO测试
[root@os-manager ~]# packstack --answer-file=answer.ini
#输入每台服务器的root密码,如果报错请根据提示进行拍错。
--> Finished Dependency Resolution
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
stderr: Warning: Permanently added '192.168.122.20' (ECDSA) to the list of known hosts.
+ trap t ERR
+ yum install -y puppet hiera openssh-clients tar nc rubygem-json
Error: Package: libselinux-ruby-2.5-12.el7.x86_64 (local)
Requires: libselinux(x86-64) = 2.5-12.el7
Installed: libselinux-2.5-14.1.el7.x86_64 (@base)
libselinux(x86-64) = 2.5-14.1.el7
Available: libselinux-2.5-12.el7.x86_64 (local)
libselinux(x86-64) = 2.5-12.el7
++ t
++ exit 1
Please check log file /var/tmp/packstack/20191110-144950-Wacbht/openstack-setup.log for more information
#报错了现在进行解决,上面错的描述的是20服务器在安装libselinux-ruby-2.5-12.el7.x86_64的时候,因为安装了过高的libselinux导致了无法进行安装,现在先将libselinux-2.5-12.el7.x86_64.rpm scp到每台计算节点的tmp目录下去,然后对每一台计算节点其进行降级处理。
[root@os-nova1 tmp]# yum downgrade libselinux-2.5-12.el7.x86_64.rpm libselinux-utils libselinux-python libsemanage setools-libs policycoreutils policycoreutils-python libsemanage-python policycoreutils-python
[root@os-nova2 tmp]# yum downgrade libselinux-2.5-12.el7.x86_64.rpm libselinux-utils libselinux-python libsemanage setools-libs policycoreutils policycoreutils-python libsemanage-python policycoreutils-python
#接下来回到管理节点上去使用应答文件对其进行安装,接下来就是漫长的等待时间。
[root@os-manager ~]# packstack --answer-file=answer.ini
ERROR : Error appeared during Puppet run: 192.168.122.10_controller.pp
Error: Could not set 'present' on ensure: Cannot allocate memory - fork(2)
#我的主节点报错了,看看什么原因,原来是内存不足看看我的配置文件。
lqh@lqh-desktop:~$ virsh edit os-manager
<domain type='kvm'>
<name>os-manager</name>
<uuid>ac382c26-5c1c-4f4f-a401-24998a8f177a</uuid>
<memory unit='KiB'>1572864</memory>
<currentMemory unit='KiB'>1572864</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
#原来是内存只分配了1.5G给它,现在修改配置将其设置为8G。
<domain type='kvm'>
<name>os-manager</name>
<uuid>ac382c26-5c1c-4f4f-a401-24998a8f177a</uuid>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
#修改内存后需要重启才能够生效现在对其重启
[root@os-manager ~]# free -m
total used free shared buff/cache available
Mem: 7982 372 7345 8 265 7345
Swap: 0 0 0
#继续
[root@os-manager ~]# packstack --answer-file=answer.ini
**** Installation completed successfully ******
Additional information:
* File /root/keystonerc_admin has been created on OpenStack client host 192.168.122.10. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.122.10/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
* The installation log file is available at: /var/tmp/packstack/20191110-154532-HEiZGv/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20191110-154532-HEiZGv/manifests
[root@os-manager ~]# sed -i '35a WSGIApplicationGroup %{GLOBAL}' /etc/httpd/conf.d/15-horizon_vhost.conf
[root@os-manager ~]# apachectl graceful
标签:das stderr openstack round 管理员 each 降级 内核 ken
原文地址:https://www.cnblogs.com/lqinghua/p/11831055.html