centos7 安装openstack-工具版

官方的安装文档 :https://docs.openstack.org/install-guide/

1,单机部署:

a,pike安装

 curl -s http://elven.vip/ks/openstack/pike.install.sh |bash

b, devstack安装

#user
sudo useradd -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack

#安装python3
yum -y install git wget
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz

tar -xvf Python-3.6.3.tgz -C /opt
cd /opt/Python-3.6.3/
yum install -y openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc cc
./configure --prefix=/usr/local/python3
make && make install
echo 'export PATH=$PATH:/usr/local/python3/bin'>>/etc/profile;   .  /etc/profile

#下载 DevStack脚本集
cd /opt/stack/
#git clone https://git.openstack.org/openstack-dev/devstack 
git clone https://github.com/openstack/devstack.git
cd devstack

#config
pass_wd=123456
cat >local.conf<

c,Puppet安装

git clone https://git.openstack.org/openstack/puppet-openstack-integration
cd puppet-openstack-integration
./all-in-one.sh

d,rdo安装

systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
systemctl restart network

setenforce 0
systemctl stop firewalld
systemctl disable firewalld

wget -O /etc/yum.repos.d/my.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y https://rdoproject.org/repos/rdo-release.rpm

yum update -y
yum install -y openstack-packstack
packstack --allinone

e, kolla安装

#1)下载使用Kolla社区的Ocata版本镜像
wget http://tarballs.openstack.org/kolla/images/centos- binary-registry-ocata.tar.gz
tar zxvf centos-binary-registry-ocata.tar.gz -C /opt/registry/

#2)下载kolla-ansible的代码
cd ~
git clone http://git.trystack.cn/openstack/kolla-ansible

#3)安装kolla-ansible
cd kolla-ansible && pip install .

#4)复制相关文件
cp -r etc/kolla /etc/kolla/
cp ansible/inventory/*  ~

#5)生成密码文件
kolla-genpwd

e, 手动安装

  1. rpm 安装openstack-rocky
  2. rpm 安装openstack-queue
yum install -y centos-release-openstack-rocky # centos-release-openstack-queens 
yum install  -y python-openstackclient 
yum install  -y openstack-selinux
yum install  -y openstack-keystone
yum install -y openstack-dashboard
yum install -y  openstack-utils 

2, 集群搭建

1,msster安装:
	fuel9.iso ===》 允许net-boot安装, (host网卡:3块--混合模式,   net网卡:1块)
		“Bootstrap Image”,选择跳过==》 保存退出,等待安装结束
		       将mirrors (2目录)和bootstrap(3目录): 上传到/var/www/nailgun目录下
			   $: fuel-createmirror
			   $:fuel-bootstrap activate d01c72e6-83f4-4a19-bb86-6085e40416e6 #bootstrapd的目录名
			   $: fuel-bootstrap list   #查看状态,已经激活 
 
2,开机,选择的ubuntu_bootstrap启动:
   controller: :允许net-boot安装, (host网卡:3块--混合模式)
   compute:      允许net-boot安装, (host网卡:3块--混合模式)
   
   
fuel9-msster:查看节点==>$: fuel node  #会发现这2个结点 
进入webui, 创建环境r
Deployment has failed. All nodes are finished. Failed tasks: Task[ntp-check/1] Stopping the deployment process!
ERROR: Unable to communicate with at least one of NTP server, checked the following host(s): ["0.fuel.pool.ntp.org", "1.fuel.pool.ntp.org", "2.fuel.pool.ntp.org"] on node node-1.domain.tld

Failed tasks: Task[netconfig/3] Stopping the deployment process!


=======================
升级 Mirantis OpenStack 9.x 到 9.2
1. 添加mos92-updates更新源

#http://mirror.fuel-infra.org/mos-repos/centos/mos11.0-centos7/os/x86_64/Packages/
# yum install -y http://mirror.fuel-infra.org/mos-repos/centos/mos9.0-centos7/9.2-updates/x86_64/Packages/mos-release-9.2-1.el7.x86_64.rpm
2. 清除 yum 缓存
# yum clean all
3. 安装 mos-playbooks
# yum install -y mos-updates
4. 切换到mos_playbooks/mos_mu/ 目录
# cd mos_playbooks/mos_mu/
5. 执行环境准备的playbook
# ansible-playbook playbooks/mos9_prepare_fuel.yml
6. 升级Fuel 节点上的包、服务、配置,期间各服务都会重启
# ansible-playbook playbooks/update_fuel.yml -e '{"rebuild_bootstrap":false}'
7. 升级Fuel bootstrap 内核
# ansible-playbook playbooks/mos9_fuel_upgrade_kernel_4.4.yml
8. 确认升级成功
# fuel2 fuel-version
 
api: '1'
auth_required: true
feature_groups: []
openstack_version: mitaka-9.0
release: '9.2'


===========================
host-only 联网

iptables -t nat -A POSTROUTING -s 10.20.0.0/24 -j MASQUERADE

10.20.0.0/24 为 host-only 网段
制作源
# vim /usr/share/fuel-mirror/ubuntu.yaml
- ubuntu_baseurl: &ubuntu_baseurl http://archive.ubuntu.com/ubuntu
+ ubuntu_baseurl: &ubuntu_baseurl http://mirrors.aliyun.com/ubuntu
mos_baseurl: &mos_baseurl http://mirror.fuel-infra.org/mos-repos/ubuntu/$mos_version
# fuel-createmirror
bootstrap
更换国内源
# vim /etc/fuel-bootstrap-cli/fuel_bootstrap_cli.yaml

repos:
    - name: ubuntu
      section: "main universe multiverse"
-     uri: "http://archive.ubuntu.com/ubuntu"
+     uri: "http://mirrors.aliyun.com/ubuntu"
      priority:
      suite: trusty
      type: deb
    - name: ubuntu-updates
      section: "main universe multiverse"
-     uri: "http://archive.ubuntu.com/ubuntu"
+     uri: "http://mirrors.aliyun.com/ubuntu"
      priority:
      suite: trusty-updates
      type: deb
    - name: ubuntu-security
      section: "main universe multiverse"
-      uri: "http://archive.ubuntu.com/ubuntu"
+      uri: "http://mirrors.aliyun.com/ubuntu"
      priority:
      suite: trusty-security
      type: deb
开始制作 bootstrap
# fuel-bootstrap build

……
Building initramfs
Building squashfs
squashfs_image clean-up
Creating archive: /tmp/59129ecd-cccd-4a13-943b-ed6000d2aa02.tar.gz
--- Building bootstrap image END (do_mkbootstrap) ---
Cleanup chroot
Bootstrap image 59129ecd-cccd-4a13-943b-ed6000d2aa02 has been built: /tmp/59129ecd-cccd-4a13-943b-ed6000d2aa02.tar.gz
导入 bootstrap
成功后在 /tmp/ 下有如下文件

# ls /tmp/*.tar.gz

/tmp/59129ecd-cccd-4a13-943b-ed6000d2aa02.tar.gz
导入 bootstrap

# fuel-bootstrap import /tmp/59129ecd-cccd-4a13-943b-ed6000d2aa02.tar.gz

Try extract /tmp/59129ecd-cccd-4a13-943b-ed6000d2aa02.tar.gz to /tmp/tmpnixoNM
Bootstrap image 59129ecd-cccd-4a13-943b-ed6000d2aa02 has been imported.
激活 bootstrap

# fuel-bootstrap activate 59129ecd-cccd-4a13-943b-ed6000d2aa02

Bootstrap image 59129ecd-cccd-4a13-943b-ed6000d2aa02 has been activated.
查看新增bootstrap

# fuel-bootstrap list

+--------------------------------------+--------------------------------------+--------+
| uuid                                 | label                                | status |
+--------------------------------------+--------------------------------------+--------+
| 59129ecd-cccd-4a13-943b-ed6000d2aa02 | 59129ecd-cccd-4a13-943b-ed6000d2aa02 | active |
+--------------------------------------+--------------------------------------+--------+

你可能感兴趣的:(云计算-openstack)