[root@controller ~]# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)
[root@controller ~]# cat /etc/hosts
10.199.118.50 controller
10.199.118.48 compute_node_01
10.199.118.49 network_node_01
10.199.118.47 block_node_01
10.199.118.34 object_node_01
10.199.118.45 object_node_02
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain
本来想集群化部署的,这个自动化部署是先试试手的,目前所有操作均在主机controller上进行。
修改epel源,这里使用阿里云的镜像服务器。
[root@packstack ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@packstack ~]# yum clean all
[root@packstack ~]# yum makecache
关闭防火墙、SELINUX
[root@packstack ~]# systemctl stop firewalld
[root@packstack ~]# systemctl disable firewalld
[root@packstack ~]# vim /etc/selinux/config
SELINUX=disabled
四条命令,完成时间完全取决于你的网速,不信?
yum update -y
# update 会升级系统内核升级范围大
# upgrade 仅升级各程序及安装
# 配置RDO源
yum install https://rdoproject.org/repos/rdo-release.rpm -y
# 安装packstack包
yum install openstack-packstack -y
# 安装allinone的的环境
packstack --allinone
# 安装大概一个小时左右,由于网络问题可能会报错,报错后重复执行即可
packstack --answer-file packstack-answers-20171129-031548.txt
# 如果需要自定义参数,需要先生存应答文件
packstack --gen-answer-file=packstack-answers
# 通过应答文件执行安装
packstack --answer-file=packstack-answers
安装RDO源我还是成功过的,不过你能不能成功,我就不知道了,尝试了一周多成功一次。
[root@controller ~]# yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-train/rdo-release-train-1.noarch.rpm
Loaded plugins: fastestmirror, langpacks, priorities
rdo-release-train-1.noarch.rpm | 6.7 kB 00:00:00
Examining /var/tmp/yum-root-t6nqQ1/rdo-release-train-1.noarch.rpm: rdo-release-train-1.noarch
Marking /var/tmp/yum-root-t6nqQ1/rdo-release-train-1.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package rdo-release.noarch 0:train-1 will be installed
--> Finished Dependency Resolution
epel/x86_64/metalink | 8.2 kB 00:00:00
epel/x86_64 | 4.7 kB 00:00:00
epel/x86_64/group_gz | 95 kB 00:00:00
epel/x86_64/updateinfo | 1.0 MB 00:00:00
epel/x86_64/primary_db | 6.8 MB 00:00:01
Dependencies Resolved
=======================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================
Installing:
rdo-release noarch train-1 /rdo-release-train-1.noarch 3.1 k
Transaction Summary
=======================================================================================================================
Install 1 Package
Total size: 3.1 k
Installed size: 3.1 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : rdo-release-train-1.noarch 1/1
Verifying : rdo-release-train-1.noarch 1/1
Installed:
rdo-release.noarch 0:train-1
Complete!
[root@controller ~]#
rdo-release.rpm总是无法下载,安装,这里通过下载工具,反复尝试,碰运气,弄到了这个6k多点的rpm。
下载链接:rdo-release.rpm(更新时间为2020年4月20日11:35:29)
最终安装方式:rz上传至Linux服务器,mv转移到/tmp目录下,通过rpm命令安装。
# 上传
rz
# 安装
mv rdo-release-train-1.noarch.rpm /tmp/
rpm -ivh /tmp/rdo-release-train-1.noarch.rpm
#重建yum缓存
yum clean
yum makecache
开始安装OpenStack
[root@controller tmp]# packstack --allinone
Welcome to the Packstack setup utility
The installation log file is available at: /var/tmp/packstack/20200420-111422-ahbXyK/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 ]
^HPre installing Puppet and discovering hosts' details[ ERROR ]
ERROR : Failed to run remote script, stdout:
stderr: Warning: Permanently added '10.199.118.50' (ECDSA) to the list of known hosts.
+ trap t ERR
+ facter -p
facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory
++ t
++ exit 127
Please check log file /var/tmp/packstack/20200420-111422-ahbXyK/openstack-setup.log for more information
Additional information:
* Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20200420-111423.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
问题剖析:
错误信息是,未能执行远程脚本
ERROR : Failed to run remote script
给出原因是,缺少共享连接库leatherman_curl.so.1.3.0
facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory
报错,查看日志文件: /var/tmp/packstack/20200420-111422-ahbXyK/openstack-setup.log
[root@controller ~]# cat /var/tmp/packstack/20200420-111422-ahbXyK/openstack-setup.log |more
2020-04-20 11:14:23::INFO::shell::100::root:: [localhost] Executing script:
ssh-keygen -f "/root/.ssh/id_rsa" -N ""
2020-04-20 11:14:23::INFO::shell::100::root:: [localhost] Executing script:
rm -rf /var/tmp/packstack/20200420-111422-ahbXyK/manifests/*pp
2020-04-20 11:14:23::INFO::shell::100::root:: [localhost] Executing script:
mkdir -p ~/.ssh
chmod 500 ~/.ssh
grep 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCi4T7KcshdVYldhUd819wCmfTNIKL+S9ru5V4mgtxaRo3tC7DxvGZwS1yMJ4+p+9GaDT+s/fyXST1K02qWVkuLN49geTajyA/Wj/071GuYReg4iA9jmsslQrStj1v
S2ul2JqaIuTOdZtgoEBqcZrZC0SSYnwWLF2CYU73QanxcviPw+Q2N9/pbUszMfhsskTymIuypDsD9hW2DRG9vG3RlGixaUy6850vmNpYvhYL2F97ibfgQgu2N2B0S3i4VRYvolEaW19tSxTCZRFPe2cRo2jimEHBRoI0ayRSU
lfVtN6uTOive5bLoH+sTnub15wlUGd3v9fer8A9dHBqpOAWd root@controller' ~/.ssh/authorized_keys > /dev/null 2>&1 || echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCi4T7KcshdVYldhUd
819wCmfTNIKL+S9ru5V4mgtxaRo3tC7DxvGZwS1yMJ4+p+9GaDT+s/fyXST1K02qWVkuLN49geTajyA/Wj/071GuYReg4iA9jmsslQrStj1vS2ul2JqaIuTOdZtgoEBqcZrZC0SSYnwWLF2CYU73QanxcviPw+Q2N9/pbUszM
fhsskTymIuypDsD9hW2DRG9vG3RlGixaUy6850vmNpYvhYL2F97ibfgQgu2N2B0S3i4VRYvolEaW19tSxTCZRFPe2cRo2jimEHBRoI0ayRSUlfVtN6uTOive5bLoH+sTnub15wlUGd3v9fer8A9dHBqpOAWd root@control
ler >> ~/.ssh/authorized_keys
chmod 400 ~/.ssh/authorized_keys
restorecon -r ~/.ssh
2020-04-20 11:14:23::INFO::shell::100::root:: [10.199.118.50] Executing script:
rpm -q --whatprovides yum-utils || yum install -y yum-utils
2020-04-20 11:14:24::INFO::shell::49::root:: Executing command:
rpm -qa --qf='%{name}-%{version}-%{release}.%{arch}
' | grep centos-release-openstack
2020-04-20 11:14:26::INFO::shell::49::root:: Executing command:
rpm -q rdo-release --qf='%{version}-%{release}.%{arch}
'
2020-04-20 11:14:26::INFO::shell::100::root:: [10.199.118.50] Executing script:
(rpm -q 'rdo-release-train' || yum install -y --nogpg https://www.rdoproject.org/repos/openstack-train/rdo-release-train.rpm) || true
2020-04-20 11:14:26::INFO::shell::100::root:: [10.199.118.50] Executing script:
yum-config-manager --enable openstack-train
2020-04-20 11:14:27::INFO::shell::100::root:: [10.199.118.50] Executing script:
rpm -q --whatprovides yum-utils || yum install -y yum-utils
yum clean metadata
2020-04-20 11:14:28::INFO::shell::100::root:: [10.199.118.50] Executing script:
yum install -y puppet hiera openssh-clients tar nc rubygem-json
yum update -y puppet hiera openssh-clients tar nc rubygem-json
rpm -q --whatprovides puppet
rpm -q --whatprovides hiera
rpm -q --whatprovides openssh-clients
rpm -q --whatprovides tar
rpm -q --whatprovides nc
rpm -q --whatprovides rubygem-json
2020-04-20 11:14:54::INFO::shell::100::root:: [10.199.118.50] Executing script:
mkdir -p /var/tmp/packstack
mkdir --mode 0700 /var/tmp/packstack/f78055f69ad04126a3d9cb9018e7f327
mkdir --mode 0700 /var/tmp/packstack/f78055f69ad04126a3d9cb9018e7f327/modules
mkdir --mode 0700 /var/tmp/packstack/f78055f69ad04126a3d9cb9018e7f327/resources
2020-04-20 11:14:55::INFO::shell::100::root:: [10.199.118.50] Executing script:
facter -p
2020-04-20 11:14:55::ERROR::run_setup::1062::root:: Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 1037, in main
single_step_aio_install(options, logFile)
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 801, in single_step_aio_install
single_step_install(options, logFile)
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 832, in single_step_install
_main(options, answerfilepath, logFile)
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 681, in _main
runSequences()
File "/usr/lib/python2.7/site-packages/packstack/installer/run_setup.py", line 648, in runSequences
controller.runAllSequences()
File "/usr/lib/python2.7/site-packages/packstack/installer/setup_controller.py", line 81, in runAllSequences
sequence.run(config=self.CONF, messages=self.MESSAGES)
File "/usr/lib/python2.7/site-packages/packstack/installer/core/sequences.py", line 109, in run
step.run(config=config, messages=messages)
File "/usr/lib/python2.7/site-packages/packstack/installer/core/sequences.py", line 50, in run
self.function(config, messages)
File "/usr/lib/python2.7/site-packages/packstack/plugins/prescript_000.py", line 1264, in preinstall_and_discover
rc, stdout = server.execute()
File "/usr/lib/python2.7/site-packages/packstack/installer/utils/shell.py", line 140, in execute
raise ScriptRuntimeError(msg, stdout=out, stderr=err)
ScriptRuntimeError: Failed to run remote script, stdout:
stderr: Warning: Permanently added '10.199.118.50' (ECDSA) to the list of known hosts.
+ trap t ERR
+ facter -p
facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory
++ t
++ exit 127
[root@controller ~]#
解决思路:
1、检查是否安装leatherman
2、回退leatherman版本1.3.0
3、复检leatherman版本
[root@controller ~]# yum list | grep leatherman
leatherman.x86_64 1.10.0-1.el7 @epel
leatherman-devel.x86_64 1.10.0-1.el7 epel
[root@controller ~]# yum downgrade leatherman
Loaded plugins: fastestmirror, langpacks, priorities
Loading mirror speeds from cached hostfile
* base: mirrors.huaweicloud.com
* epel: mirrors.aliyun.com
* extras: mirrors.huaweicloud.com
* openstack-train: mirrors.huaweicloud.com
* rdo-qemu-ev: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package leatherman.x86_64 0:1.3.0-9.el7 will be a downgrade
--> Processing Dependency: libboost_log.so.1.59.0()(64bit) for package: leatherman-1.3.0-9.el7.x86_64
--> Processing Dependency: libboost_log_setup.so.1.59.0()(64bit) for package: leatherman-1.3.0-9.el7.x86_64
---> Package leatherman.x86_64 0:1.10.0-1.el7 will be erased
--> Running transaction check
---> Package boost159-log.x86_64 0:1.59.0-2.el7.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================
Downgrading:
leatherman x86_64 1.3.0-9.el7 openstack-train 347 k
Installing for dependencies:
boost159-log x86_64 1.59.0-2.el7.1 openstack-train 380 k
Transaction Summary
=========================================================================================================================================================================
Install ( 1 Dependent package)
Downgrade 1 Package
Total download size: 727 k
Is this ok [y/d/N]: y
Downloading packages:
(1/2): leatherman-1.3.0-9.el7.x86_64.rpm | 347 kB 00:00:00
(2/2): boost159-log-1.59.0-2.el7.1.x86_64.rpm | 380 kB 00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.3 MB/s | 727 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : boost159-log-1.59.0-2.el7.1.x86_64 1/3
Installing : leatherman-1.3.0-9.el7.x86_64 2/3
Cleanup : leatherman-1.10.0-1.el7.x86_64 3/3
Verifying : leatherman-1.3.0-9.el7.x86_64 1/3
Verifying : boost159-log-1.59.0-2.el7.1.x86_64 2/3
Verifying : leatherman-1.10.0-1.el7.x86_64 3/3
Removed:
leatherman.x86_64 0:1.10.0-1.el7
Installed:
leatherman.x86_64 0:1.3.0-9.el7
Dependency Installed:
boost159-log.x86_64 0:1.59.0-2.el7.1
Complete!
[root@controller ~]# yum list | grep leatherman
leatherman.x86_64 1.3.0-9.el7 @openstack-train
leatherman.x86_64 1.10.0-1.el7 epel
leatherman-devel.x86_64 1.10.0-1.el7 epel
问题解决,继续安装。
[root@controller ~]# packstack --allinone
Welcome to the Packstack setup utility
The installation log file is available at: /var/tmp/packstack/20200420-140900-H6wcO6/openstack-setup.log
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 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 10.199.118.50_controller.pp
10.199.118.50_controller.pp: [ DONE ]
Applying 10.199.118.50_network.pp
10.199.118.50_network.pp: [ DONE ]
Applying 10.199.118.50_compute.pp
10.199.118.50_compute.pp: [ DONE ]
Applying Puppet manifests [ DONE ]
Finalizing [ DONE ]
**** Installation completed successfully ******
Additional information:
* Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20200420-140901.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
* Warning: NetworkManager is active on 10.199.118.50. OpenStack networking currently does not work on systems that have the Network Manager service enabled.
* File /root/keystonerc_admin has been created on OpenStack client host 10.199.118.50. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://10.199.118.50/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
* Because of the kernel update the host 10.199.118.50 requires reboot.
* The installation log file is available at: /var/tmp/packstack/20200420-140900-H6wcO6/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20200420-140900-H6wcO6/manifests
[root@controller ~]#
后面是来自美少女静静的等待,我这边等待了半个小时。
* Because of the kernel update the host 10.199.118.50 requires reboot.
* To access the OpenStack Dashboard browse to http://10.199.118.50/dashboard .
* A new answerfile was created in: /root/packstack-answers-20200420-140901.txt
账号密码应该都对,提示无法登录。
检查系统时间
修改 /etc/ntp.conf本机就是cotroller,将自定义的内容全部注释掉。
启动ntp,同步时间,这里当时没有截屏,只能看日志了。
[17:13:37][root@controller ~]# openstack service list
[17:13:39]Missing value auth-url required for auth plugin password
环境变量有问题?通过export -p命令查看,确实空白
[root@controller keystone]# export -p
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME="controller"
declare -x LANG="en_US.UTF-8"
declare -x LESSOPEN="||/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="root"
declare -x LS_COLORS="rs=0:d......x=01;36:*.xspf=01;36:"
declare -x MAIL="/var/spool/mail/root"
declare -x OLDPWD="/opt"
declare -x PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
declare -x PWD="/usr/share/keystone"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x TERM="xterm"
declare -x USER="root"
declare -x XDG_DATA_DIRS="/root/.local/share/flat.....al/share:/usr/share"
declare -x XDG_SESSION_ID="1"
新建admin-openrc.sh,初始化华景变量。
[root@controller ~]# cat admin-openrc.sh
export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=1234@qwer.
export OS_AUTH_URL=http://controller:5000/v3
export OS_IMAGE_API_VERSION=2
export OS_VOLUME_API_VERSION=2
[root@controller ~]# source admin-openrc.sh
[root@controller ~]# env |grep OS
[root@controller ~]# openstack service list
The request you have made requires authentication. (HTTP 401) (Request-ID: req-671224eb-817e-4001-9d5c-219f98633cc9)
token没配置好?
[root@controller ~]# cat /etc/keystone/keystone.conf |grep admin_token
设置OS_TOKEN
[root@controller ~]# openssl rand -hex 10
2886b9805b49e481390d
[root@controller ~]# export OS_TOKEN=2886b9805b49e481390d
[root@controller ~]# cat /etc/keystone/keystone.conf |grep admin_token
# value is ignored and the `admin_token` middleware is effectively disabled.
#admin_token =
admin_token=2886b9805b49e481390d
[root@controller ~]# env |grep TOKEN
OS_TOKEN=2886b9805b49e481390d
[root@controller ~]# openstack service list
__init__() got an unexpected keyword argument 'token'
检查数据库,没有发现问题,不需要密码。
检查用户名、密码,该创建的都创建了,应该也没问题。
难道是取消token认证?
后来发现了两篇文章:
Centos7+Packstack安装部署Openstack Mitaka之(一) 安装Packstack
Centos7+Packstack安装部署Openstack Mitaka之(二) packstack-answers-file
通过packstack快速安装openstack
packstack 部署遇到的坑
RDO是啥?
红帽Red Hat Enterprise Linux OpenStack Platform的社区版,类似RHEL和Fedora,RHEV和oVirt这样的关系。
RDO能干啥?
OpenStack的安装是一个难题,组件众多,非常麻烦。最早支持OS的是Ubuntu,所以在ubuntu上有方便快捷的OpenStack安装脚本。OpenStack越来越重要,越来越被大家认可,所以红帽也推出了OpenStack的快捷安装部署项目,这个项目就是RDO。原理是整合上游的OpenStack版本,然后根据红帽的系统做裁剪和定制,帮助用户进行选择,对用户来说,就是简单的几步,完成了OpenStack的部署。如果手工部署OpenStack,可能需要好几天,使用RDO就几个命令,再加一两个小时的等待。当然,牺牲了灵活性,但是对最终用户来说,要的是简单部署,稳定使用。
1、http状态码
302
401
2、概念架构逻辑架构要精通从而故障诊断
3、glance镜像文件服务
raw
qcow
4、metadata虚拟机镜像元数据
OpenStackClient
http://docs.openstack.org/cli-reference/glance.html
5、container-format虚拟机镜像容器格式
bare:没有容器或者没有封装metadata
ovf:OVF容器格式
docker:docker容器格式
7、8是nortun
9、是nova
10-12、是运维及开发