Packstack单节点一键部署openstack-Train版

#记录一台单节点物理服务器使用PackStack部署OpenStack-Train版的操作

戴尔R720
系统:centos7.8.2003
cpu型号: E5-2670v2
2C8核32线程
内存 32G
网络环境: 
	eth0 192.168.100.106	物理外网
	eth1 172.16.0.106		私有内网	

#服务器基础优化

echo 'net.ipv4.ip_forward=1 ' >>/etc/sysctl.conf 
echo 'net.ipv4.tcp_tw_recycle=1 ' >>/etc/sysctl.conf
echo 'net.ipv4.tcp_tw_reuse=1 ' >>/etc/sysctl.conf 
sysctl -p
chmod +x /etc/rc.d/rc.local
yum install -y mlocate lrzsz tree vim nc nmap wget bash-completion bash-completion-extras cowsay sl htop iotop iftop lsof net-tools sysstat unzip bc psmisc ntpdate wc telnet-server bind-utils sshpass
echo 'localhost	192.168.100.106' >>/etc/hosts
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
systemctl stop NetworkManager
systemctl disable NetworkManager
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y mlocate lrzsz tree vim nc nmap wget bash-completion bash-completion-extras cowsay sl htop iotop iftop lsof net-tools sysstat unzip bc psmisc ntpdate wc telnet-server bind-utils sshpass
sed -i 's#keepcache=0#keepcache=1#g' /etc/yum.conf
yum clean all		
yum makecache
ntpdate ntp1.aliyun.com
echo '*/30 * * * *  /sbin/ntpdate ntp1.aliyun.com >/dev/null 2>&1' >>/var/spool/cron/root

#安装train版yum源

yum install centos-release-openstack-train -y

#安装openstack-packstack工具用于生成openstack应答文件

yum install openstack-packstack -y
packstack --gen-answer-file=openstack.txt

packstack --allinone 				 #allinone模式
packstack --gen-answer-file=<file> 	 #生成部署配置文件
packstack --answer-file=<file>     #选择应答文件

#packstack每个版本的配置文件均有小改动,不要修改错位置
可以详细学习一下配置文件的各个模块的配置参数,可根据自己实际需求更改

[19:57 root@localhost ~]# vim openstack.txt
41行:		y-n #SWIFT是OpenStack的对象存储组件,默认是Y,在生产环境中一般是不装,所以改n
50行:		y-n #不安装该服务
97行:		10.0.1.120,10.0.1.130 #计算节点ip地址
808 		openvswitch
813:		physnet1      		#flat网络这边要设置物理网卡名字
840 		openvswitch		#L2网络的代理模式,也可选择linuxbridge
858:		physnet1:br-ex    #这边要设置物理网卡的名字
869:		br-ex:eth0			#这边br-ex:eth0是网络节点的nat网卡,到时候安装完毕之后IP地址会漂到这个上
1181:	y-n #DEMO是OpenStack联网下载一个测试镜像,这边没联网。说以改成n

##更改密码(123456)

sed -i -r 's/(.+_PW)=.+/\1=123456/' openstack.txt

#备份配置文件

egrep -v "^#|^$" openstack.txt >openstack.txt.bak1

#查看所有的主机ip地址是否都指定到eth0网卡

[20:01 root@localhost ~]# grep 'HOST=' openstack.txt
CONFIG_CONTROLLER_HOST=192.168.100.106
CONFIG_VCENTER_HOST=
CONFIG_STORAGE_HOST=192.168.100.106
CONFIG_SAHARA_HOST=192.168.100.106
CONFIG_AMQP_HOST=192.168.100.106
CONFIG_MARIADB_HOST=192.168.100.106
CONFIG_TEMPEST_HOST=
CONFIG_REDIS_HOST=192.168.100.106

#一键部署单节点

[20:15 root@localhost ~]# packstack --answer-file=openstack.txt
Welcome to the Packstack setup utility

The installation log file is available at: /var/tmp/packstack/20200614-205624-uEmdI2/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 Gnocchi entries                            [ DONE ]
Preparing Redis entries                              [ DONE ]
Preparing Ceilometer entries                         [ DONE ]
Preparing Puppet manifests                           [ DONE ]
Copying Puppet modules and manifests                 [ DONE ]
Applying 192.168.100.106_controller.pp
192.168.100.106_controller.pp:                       [ DONE ]            
Applying 192.168.100.106_network.pp
192.168.100.106_network.pp:                          [ DONE ]         
Applying 192.168.100.106_compute.pp
192.168.100.106_compute.pp:                          [ DONE ]         
Applying Puppet manifests                            [ DONE ]
Finalizing                                           [ DONE ]

 **** Installation completed successfully ******

Additional information:
 * 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.100.106. To use the command line tools you need to source the file.
 * To access the OpenStack Dashboard browse to http://192.168.100.106/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/20200614-205624-uEmdI2/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20200614-205624-uEmdI2/manifests

#packstack部署禁止了openstack的dashbrard界面对域的支持,需要可打开

vim /etc/openstack-dashboard/local_settings
79 OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
85 OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default'
461 TIME_ZONE = "Asia/Shanghai"	#配置时区为亚洲上海

systemctl restart httpd.service memcached.service

#故障报错

facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory

leatherman rpm包版本问题
[20:06 root@localhost ~/openstack]# yum list | grep leatherman
leatherman.x86_64                        1.10.0-1.el7                  @epel    
leatherman-devel.x86_64                  1.10.0-1.el7                  epel 

而facter需要1.3.0
[20:09 root@localhost ~/openstack]# facter -p
facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory

回退leatherman版本
yum downgrade leatherman -y
**OpenStack 使用 Packstack 工具一键部署步骤**: 1. **准备环境**: - 确保你的服务器满足OpenStack的最低系统要求,比如Ubuntu 18.04或更高本。 - 安装必要的依赖包,包括`git`, `curl`, 和 `python-dev`等。 2. **下载并验证**: - 使用`curl`从OpenStack官方仓库下载`Packstack`脚本: ``` curl https://tarballs.openstack.org/packstack/pike/pike-pacemaker-packstack-latest.tar.gz > packstack.tar.gz ``` - 验证下载的脚本: ``` sha256sum packstack.tar.gz ``` 3. **初始化环境**: - 创建一个新的虚拟环境: ``` virtualenv packstack-env source packstack-env/bin/activate ``` - 安装`Packstack`及其依赖: ``` pip install openstack-packstack ``` 4. **配置安装**: - 运行`packstack`命令,它会引导你通过一系列交互式设置过程,例如选择网络架构、存储后端、认证方式等: ``` ./bin/packstack --allinone ``` 按照屏幕提示填写信息,并确认安装选项。 5. **等待部署**: - 安装过程可能会花费一些时间,因为它会自动部署所有组件,如Nova、Swift等。 - 在此期间,你可以跟踪日志,了解进度(默认日志路径一般在`/var/log/openstack`下)。 6. **完成并检查**: - 安装完成后,可以登录Horizon Web界面(默认地址是`http://<controller_ip>/horizon`),验证OpenStack是否正常运行。 7. **维护和更新**: - 如果需要添加或更改服务,可以在将来使用`./bin/packstack --answer-file=answerfile.yaml upgrade`来升级已有的OpenStack部署
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值