一.安装centos7.5
1.1 升级内核4.4
1.1.1:查看内核版本
uname -rs
Linux 3.10.0-957.el7.x86_64
1.1.2:虚拟文件系统
cpuinfo:标识了处理器的类型和速度
pci:显示在 PCI 总线上找到的设备
modules:当前加载到内核中的模块
version:系统版本及内核版本
cat /proc/version
Linux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018
1.1.3. 启用 ELRepo 仓库
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
查看可用的系统内核包
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
elrepo-kernel | 2.9 kB 00:00:00
elrepo-kernel/primary_db | 1.8 MB 00:00:01
可安装的软件包
kernel-lt.x86_64 4.4.180-2.el7.elrepo elrepo-kernel
kernel-lt-devel.x86_64 4.4.180-2.el7.elrepo elrepo-kernel
kernel-lt-doc.noarch 4.4.180-2.el7.elrepo elrepo-kernel
kernel-lt-headers.x86_64 4.4.180-2.el7.elrepo elrepo-kernel
kernel-lt-tools.x86_64 4.4.180-2.el7.elrepo elrepo-kernel
kernel-lt-tools-libs.x86_64 4.4.180-2.el7.elrepo elrepo-kernel
kernel-lt-tools-libs-devel.x86_64 4.4.180-2.el7.elrepo elrepo-kernel
kernel-ml.x86_64 5.1.7-1.el7.elrepo elrepo-kernel
kernel-ml-devel.x86_64 5.1.7-1.el7.elrepo elrepo-kernel
kernel-ml-doc.noarch 5.1.7-1.el7.elrepo elrepo-kernel
kernel-ml-headers.x86_64 5.1.7-1.el7.elrepo elrepo-kernel
kernel-ml-tools.x86_64 5.1.7-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 5.1.7-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 5.1.7-1.el7.elrepo elrepo-kernel
perf.x86_64 5.1.7-1.el7.elrepo elrepo-kernel
python-perf.x86_64 5.1.7-1.el7.elrepo elrepo-kernel
1.1.4.安装4.4版本内核
–enablerepo 选项开启 CentOS 系统上的指定仓库。默认开启的是 elrepo,这里用 elrepo-kernel 替换
yum --enablerepo=elrepo-kernel install kernel-lt
......
Downloading packages:
kernel-lt-4.4.180-2.el7.elrepo.x86_64.rpm | 39 MB 00:00:09
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
正在安装 : kernel-lt-4.4.180-2.el7.elrepo.x86_64 1/1
验证中 : kernel-lt-4.4.180-2.el7.elrepo.x86_64 1/1
已安装:
kernel-lt.x86_64 0:4.4.180-2.el7.elrepo
1.1.5.查看系统可用内核
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (4.4.180-2.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)
2 : CentOS Linux (0-rescue-83a8d5da3df34899949d3616c184039d) 7 (Core)
1.1.6.修改启动文件-设置grub2
sudo vi /etc/default/grub
GRUB_DEFAULT=0
1.1.7.生成grub 配置文件并重启
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
启动后查看内核
1.1.8.删除旧的内核文件(可选)
查看内核版本
uname -rs
Linux 4.4.180-2.el7.elrepo.x86_64
rpm -qa | grep kernel
kernel-tools-3.10.0-957.el7.x86_64
kernel-lt-4.4.180-2.el7.elrepo.x86_64
kernel-tools-libs-3.10.0-957.el7.x86_64
kernel-3.10.0-957.el7.x86_64
使用yum remove删除内核
yum remove kernel-tools-3.10.0-957.el7.x86_64 kernel-tools-libs-3.10.0-957.el7.x86_64 kernel-3.10.0-957.el7.x86_64
1.1.9.通过 yum-utils 工具管理多于内核
如果安装的内核不多于 3 个,yum-utils 工具不会删除任何一个。只有在安装的内核大于 3 个时,才会自动删除旧内核。
安装
yum install yum-utils
删除
package-cleanup --oldkernels
1.2 换国内yum源
1.2.1: 安装wget,net-tools
sudo yum install -y wget net-tools
1.2.2:备份源地址
cd /etc/yum.repos.d/
sudo mkdir repo_bak
sudo mv *.repo repo_bak/
1.2.3:更新下载源文件
sudo wget http://mirrors.aliyun.com/repo/Centos-7.repo
sudo wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
# 下载阿里开源镜像的epel源文件
sudo wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 下载网易开源镜像的epel源文件
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
1.2.4:安装epel源
sudo yum install -y epel-release
更新
sudo yum clean all
sudo yum makecache
查看系统可用的yum源和所有的yum源
sudo yum repolist enabled
sudo yum repolist all
二.Centos系统初始化
2.1.关闭并禁用防火墙:
systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
systemctl disable NetworkManager
2.2.关闭selinux:
setenforce 0
2.3.编辑/etc/selinux/config文件内容,将SELINUX值enforcing改为disabled:
sed -ri 's#(SELINUX=).*#\1disabled#' /etc/selinux/config
2.4.配置RDO安装源:
yum install -y http://rdo.fedorapeople.org/rdo-release.rpm
三.openstack相关问题
3.1 使用packstack单机安装
3.1.1:安装packstack工具
yum install -y openstack-packstack
3.1.2:Packstack一键安装:
packstack --allinone
====================================
3.1.3:packstack 删除
for x in $(virsh list --all | grep instance- | awk '{print $2}') ; do virsh destroy $x ; virsh undefine $x ; done ; yum remove -y nrpe "*nagios*" puppet ntp "ntp-*" ntpdate "rdo-release" "*openstack*" "*nova*" "*keystone*" "*glance*" "*cinder*" "*swift*" mysql mysql-server httpd "*memcache*" scsi-target-utils iscsi-initiator-utils perl-DBI perl-DBD-MySQL ; ps -ef | grep -i repli | grep swift | awk '{print $2}' | xargs kill ; rm -rf /etc/nagios /etc/yum.repos.d/packstack_* /root/.my.cnf /var/lib/mysql/ /var/lib/glance /var/lib/nova /etc/nova /etc/swift /srv/node/device*/* /var/lib/cinder/ /etc/rsync.d/frag* /var/cache/swift /var/log/keystone /tmp/keystone-signing-nova ; find /etc | grep rpmsave | xargs rm -vf ; umount /srv/node/device* ; killall -9 dnsmasq tgtd httpd ; setenforce 1 ; vgremove -f cinder-volumes ; losetup -a | sed -e 's/:.*//g' | xargs losetup -d ; find /etc/pki/tls -name "ssl_ps*" | xargs rm -rf ; for x in $(df | grep "/lib/" | sed -e 's/.* //g') ; do umount $x ; done
3.1.4:安装过程描述
Welcome to the Packstack setup utility
The installation log file is available at: /var/tmp/packstack/20190605-163619-cLBY2p/openstack-setup.log
Packstack changed given value to required value /root/.ssh/id_rsa.pub
Installing:
Clean Up [ DONE ]
Discovering ip protocol version [ DONE ]
Setting up ssh keys [ DONE ]
Preparing servers [ DONE ]
Pre installing Puppet and discovering hosts' details [ DONE ]
Preparing pre-install entries [ DONE ]
Setting up CACERT [ DONE ]
Preparing AMQP entries [ DONE ]
Preparing MariaDB entries [ DONE ]
Fixing Keystone LDAP config parameters to be undef if empty[ DONE ]
Preparing Keystone entries [ DONE ]
Preparing Glance entries [ DONE ]
Checking if the Cinder server has a cinder-volumes vg[ DONE ]
Preparing Cinder entries [ DONE ]
Preparing Nova API entries [ DONE ]
Creating ssh keys for Nova migration [ DONE ]
Gathering ssh host keys for Nova migration [ DONE ]
Preparing Nova Compute entries [ DONE ]
Preparing Nova Scheduler entries [ DONE ]
Preparing Nova VNC Proxy entries [ DONE ]
Preparing OpenStack Network-related Nova entries [ DONE ]
Preparing Nova Common entries [ DONE ]
Preparing Neutron LBaaS Agent entries [ DONE ]
Preparing Neutron API entries [ DONE ]
Preparing Neutron L3 entries [ DONE ]
Preparing Neutron L2 Agent entries [ DONE ]
Preparing Neutron DHCP Agent entries [ DONE ]
Preparing Neutron Metering Agent entries [ DONE ]
Checking if NetworkManager is enabled and running [ DONE ]
Preparing OpenStack Client entries [ DONE ]
Preparing Horizon entries [ DONE ]
Preparing Swift builder entries [ DONE ]
Preparing Swift proxy entries [ DONE ]
Preparing Swift storage entries [ DONE ]
Preparing Gnocchi entries [ DONE ]
Preparing Redis entries [ DONE ]
Preparing Ceilometer entries [ DONE ]
Preparing Aodh entries [ DONE ]
Preparing Puppet manifests [ DONE ]
Copying Puppet modules and manifests [ DONE ]
Applying 192.168.10.62_controller.pp
Testing if puppet apply is finished: 192.168.10.62_controller.pp [ / ]
.......[一个多小时马上就过去了,乘空写了这些记录,煮了一泡白茶下肚]
Applying 192.168.10.62_controller.pp
192.168.10.62_controller.pp: [ DONE ]
Applying 192.168.10.62_network.pp
192.168.10.62_network.pp: [ DONE ]
Applying 192.168.10.62_compute.pp
192.168.10.62_compute.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]
**** Installation completed successfully ******
Additional information:
* Parameter CONFIG_NEUTRON_L2_AGENT: You have choosen OVN neutron backend. Note that this backend does not support LBaaS, VPNaaS or FWaaS services. Geneve will be used as encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20190605-163619.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
* File /root/keystonerc_admin has been created on OpenStack client host 192.168.10.62. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://192.168.10.62/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
* Because of the kernel update the host 192.168.10.62 requires reboot.
* The installation log file is available at: /var/tmp/packstack/20190605-163619-cLBY2p/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20190605-163619-cLBY2p/manifests
安装完成 默认登录用户密码在 ~/ keystonerc_admin keystonerc_demo
登陆:http://192.168.10.62/dashboard
使用记录,未完待续。。。。。。