###本环境为物理机
controller eth0,eth1
compute01 eth0
compute02 (带P40 gpu卡) eth0
eth0: 管理网段,可上网,下载安装包(nat模式)
eth1: provider网卡,(桥接模式),up with no ip
------------+---------------------------+---------------------------+----------------------
| | |
eth0|192.168.200.151 eth0|192.168.200.152 eth0|192.168.200.153
| | |
+-----------+------------+ +-----------+------------+ +-----------+------------+
| controller | | compute01 | | compute02(GPU ) |
| | | | | |
| | | | | |
| | | | | |
+-----------++-----------+ +-----------+------------+ +-----------+------------+
||
||
eth1 up with no ip
||
===========系统初始化(每个节点)
###1.下载基础工具
yum install -y vim wget net-tools telnet bash-completion.noarch epel-release yum-utils rsync chrony
###2.关闭fw
systemctl stop firewalld && systemctl disable firewalld
sed -ri 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
###3.更改上海时间
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
###4. 安装docker
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce -y
systemctl start docker && systemctl enable docker
mkdir -p /etc/systemd/system/docker.service.d/
tee /etc/systemd/system/docker.service.d/kolla.conf << 'EOF'
[Service]
MountFlags=shared
EOF
cat << EOF > /etc/docker/daemon.json
{
"registry-mirrors": ["https://6u0i88u7.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload && systemctl restart docker
#####安装依赖
yum -y install epel-release
yum -y install python-pip
yum -y install python-devel libffi-devel gcc openssl-devel libselinux-python
####pip源
for line in `cat /etc/hosts | sed 1,2d | awk '{print $2}' `
do
echo $line
ssh $line "mkdir ~/.pip"
ssh $line "cat << EOF > ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn
EOF"
done
#####kolla-controller 免密和ansible
ssh-copy-id -i kolla-compute01/02
[root@kolla-controller ~]# pip install ansible
[root@kolla-controller ~]# pip --version
pip 20.2.3 from /usr/lib/python2.7/site-packages/pip (python 2.7)
[root@kolla-controller ~]# pip --version
pip 20.2.3 from /usr/lib/python2.7/site-packages/pip (python 2.7)
[root@kolla-controller ~]# ansible --version
/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
from cryptography.exceptions import InvalidSignature
ansible 2.10.2
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Apr 2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
[root@kolla-controller ~]# pip install kolla-ansible==9.0.1 --ignore-installed PyYAML
[root@kolla-controller ~]# cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
[root@kolla-controller~]# cp /usr/share/kolla-ansible/ansible/inventory/* /etc/kolla/
[root@kolla-controller ~]# ls /etc/kolla/
all-in-one globals.yml multinode passwords.yml
######controller 节点上也部署cinder-volume
[root@kolla-controller ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- 854.00g 0
/dev/sdb1 cinder-volumes lvm2 a-- <931.51g 46.35g
/dev/sdc1 lvm2 --- 800.00g 800.00g
[root@kolla-controller ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 3 0 wz--n- 854.00g 0
cinder-volumes 1 2 0 wz--n- <931.51g 46.35g
#######配置multi
[root@kolla-controller ~]# more /etc/kolla/multinode
# These initial groups are the only groups required to be modified. The
# additional groups are for more control of the environment.
[control]
# These hostname must be resolvable from your deployment host
kolla-controller
# The above can also be specified as follows:
#control[01:03] ansible_user=kolla
# The network nodes are where your l3-agent and loadbalancers will run
# This can be the same as a host in the control group
[network]
kolla-controller
[compute]
kolla-compute01
kolla-compute02
[monitoring]
kolla-controller
# When compute nodes and control nodes use different interfaces,
# you need to comment out "api_interface" and other interfaces from the globals.yml
# and specify like below:
#compute01 neutron_external_interface=eth0 api_interface=em1 storage_interface=em1 tunnel_interface=em1
[storage]
kolla-controller
[deployment]
#localhost ansible_connection=local
kolla-controller
#######部署 (可参考我那kolla-ceph集群部署步骤,这大致写下)
####1.修改OpenStack各服务的密码
[root@kolla-controller ~]# kolla-genpwd
vim /etc/kolla/passwords.yml
keystone_admin_password: admin.123 修改
####2. 编辑global.yml
vim /etc/kolla/globals.yml
//第14行和第15行,选择下载的基础镜像,5选1
# Valid options are ['centos', 'debian', 'oraclelinux', 'rhel', 'ubuntu']
kolla_base_distro: "centos"
//第17行和第18行,选择的安装方法,2选1。binary二进制安装,source源码安装
# Valid options are [ binary, source ]
kolla_install_type: "source"
//第20行和第21行,选择OpenStack的版本标签,详细请看:https://releases.openstack.org/
kolla openstack nova GPU 实现
最新推荐文章于 2023-06-21 09:17:53 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)