Opensack-T版脚本安装
openStack-train 搭建部署
项目环境:
主机名 | 外网口(net) | 内口(仅主机)s | 配置 |
---|---|---|---|
controller | 192.168.220.10/192.168.220.1/24 | 192.168.100.10 | 2u/4G/40G |
compute | 192.168.100.11/192.168.220.1/24 | 192.168/100.11 | 2u/4G/40G |
所有节点
yum install centos-release-openstack-train -y
需要依赖什么安装的源
# yum install python-openstackclient -y
# yum install openstack-selinux -y
数据库安装
# yum install mariadb mariadb-server python2-PyMySQL -y
配置 ;/etc/my.cnf.d/openstack.cnf``/etc/my.cnf.d/
[mysqld]
bind-address = 192.168.220.10
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
# systemctl enable mariadb.service --now
# mysql_secure_installation
Set root password? [Y/n] y
New password: 123
Re-enter new password: 123
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
消息队列
# yum install rabbitmq-server -y
# systemctl enable rabbitmq-server.service --now
# rabbitmqctl add_user openstack openstack123
Creating user "openstack" ...
# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/" ...
缓存服务
# yum install memcached python-memcached -y
/etc/sysconfig/memcached
OPTIONS="-l 127.0.0.1,::1,controller"
# systemctl enable memcached.service --now
Keystone
mysql -u root -p123
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone123';
exit
安装和配置组件
yum install openstack-keystone httpd mod_wsgi vim -y
/etc/keystone/keystone.conf
[database]
connection = mysql+pymysql://keystone:keystone123@controller/keystone
[token]
provider = fernet
填充身份服务数据库:
su -s /bin/sh -c "keystone-manage db_sync" keystone
mysql -ukeystone -pkeystone123 -h localhost -e "use keystone; show tables;"
初始化费内特密钥存储库 :
# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
# keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
引导身份服务:
# keystone-manage bootstrap --bootstrap-password admin \
--bootstrap-admin-url http://controller:5000/v3/ \
--bootstrap-internal-url http://controller:5000/v3/ \
--bootstrap-public-url http://controller:5000/v3/ \
--bootstrap-region-id RegionOne
http服务
/etc/httpd/conf/httpd.conf
ServerName controller
/usr/share/keystone/wsgi-keystone.conf
# ln -s /usr/share/keystone/wsgi-keystone.conf /etc/httpd/conf.d/
# systemctl enable httpd.service --now
环境变量
cat > admin.sh << eof #admin 用户
#!/bash/bin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
eof
cat > myuser.sh << eof #myuser用户
#!/bash/bin
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_NAME=myproject
export OS_USERNAME=myuser
export OS_PASSWORD=DEMO_PASS
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
eof
创建 域,项目,用户,角色
$ openstack domain create --description "An Example Domain" example
$ openstack project create --domain default --description "Service Project" service
$ openstack project create --domain default --description "Demo Project" myproject
$ openstack user create --domain default --password myuser myuser
$ openstack role create myrole
$ openstack role add --project myproject --user myuser myrole
验证
$ unset OS_AUTH_URL OS_PASSWORD
$openstack --os-auth-url http://controller:5000/v3 --os-project-domain-name Default --os-user-domain-name Default --os-project-name admin --os-username admin token issue
$ openstack --os-auth-url http://controller:5000/v3 --os-project-domain-name Default --os-user-domain-name Default --os-project-name myproject --os-username myuser token issue
$ . admin-openrc
$ openstack token issue
Glance
$ mysql -u root -p123
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance123';
exit
创建服务凭据
创建用户
$ openstack user create --domain default --password glance123 glance
$ openstack role add --project service --user glance admin
$ openstack service create --name glance --description "OpenStack Image" image
创建影像服务 API 端点:
$ openstack endpoint create --region RegionOne image public http://controller:9292
$ openstack endpoint create --region RegionOne image internal http://controller:9292
$ openstack endpoint create --region RegionOne image admin http://controller:9292
安装
# yum install openstack-glance -y
/etc/glance/glance-api.conf
[database]
connection = mysql+pymysql://glance:glance123@controller/glance
[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = glance123
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
# su -s /bin/sh -c "glance-manage db_sync" glance
# mysql -uglance -pglance123 -h localhost -e "use glance; show tables;"
# systemctl enable openstack-glance-api.service --now
glance image-create --name "cirros5" --file cirros-0.5.1-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public
Placement
$ mysql -u root -p123
CREATE DATABASE placement;
GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY 'placement123';
exit
创建账号、域、用户等配置
openstack user create --domain default --password placement123 placement # 设置密码,统一placement
openstack role add --project service --user placement admin
openstack service create --name placement --description "Placement API" placement
openstack endpoint create --region RegionOne placement public http://controller:8778
openstack endpoint create --region RegionOne placement internal http://controller:8778
openstack endpoint create --region RegionOne placement admin http://controller:8778
安装和配置组件
# yum install openstack-placement-api -y
/etc/placement/placement.conf
[placement_database]
connection = mysql+pymysql://placement:placement123@controller/placement
[api]
auth_strategy = keystone
[keystone_authtoken]
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = placement
password = placement123
# su -s /bin/sh -c "placement-manage db sync" placement
# mysql -uplacement -pplacement123 -h localhost -e "use placement; show tables;"
解决bug(最后加入,T版后续没有解决方案,去O版找)
cat /etc/httpd/conf.d/00-placement-api.conf
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
# systemctl restart httpd
Nova-controller&compute
- controller
$ mysql -u root -p123
CREATE DATABASE nova_api;
CREATE DATABASE nova;
CREATE DATABASE nova_cell0;
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'nova123';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova123';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova_cell0'@'%' IDENTIFIED BY 'nova123';
exit
创建计算服务凭证
$ openstack user create --domain default --password nova123 nova
$ openstack role add --project service --user nova admin
$ openstack service create --name nova --description "OpenStack Compute" compute
$ openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
$ openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
$ openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
安装服务
# yum install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler -y
/etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack123@controller:5672/
my_ip = 192.168.220.10
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api_database]
connection = mysql+pymysql://nova:nova123@controller/nova_api
[database]
connection = mysql+pymysql://nova:nova123@controller/nova
[api]
auth_strategy = keystone
[keystone_authtoken]
www_authenticate_uri = http://controller:5000/
auth_url = http://controller:5000/
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = nova123
[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = placement123
# su -s /bin/sh -c "nova-manage api_db sync" nova
# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
# su -s /bin/sh -c "nova-manage db sync" nova
验证:
# nova-manage cell_v2 list_cells
完成安装
# systemctl enable openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service --now
# systemctl restart openstack-nova-api.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
# openstack compute service list
- compute
# yum install openstack-nova-compute
/etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:openstack123@controller
my_ip = 192.168.220.10
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone
[keystone_authtoken]
www_authenticate_uri = http://controller:5000/
auth_url = http://controller:5000/
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = nova123
[vnc]
enabled = true
server_listen = 0.0.0.0
server_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:5000/v3
username = placement
password = placement123
虚拟化设置
$ egrep -c '(vmx|svm)' /proc/cpuinfo
/etc/nova/nova.conf
[libvirt]
# ...
virt_type = qemu
# systemctl enable libvirtd.service openstack-nova-compute.service --now
将计算节点添加到单元数据库
- controller
$ . admin-openrc
$ openstack compute service list --service nova-compute
# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
- 注意
添加新的计算节点时,必须在控制器节点上运行以注册这些新的计算节点。或者,您可以在 中设置适当的间隔:nova-manage cell_v2 discover_hosts``/etc/nova/nova.conf
[scheduler]
discover_hosts_in_cells_interval = 60
Opensack-T版脚本安装的更多相关文章
- RedHat系列软件管理(第二版) --脚本安装
RedHat系列软件管理 --脚本安装 一.解压缩 tar -zxvf webmin-1.700.tar.gz 二.进入相关目录 cd webmin-1.700 三.如果此时执行./configure ...
- *** Python版一键安装脚本
本脚本适用环境:系统支持:CentOS 6,7,Debian,Ubuntu内存要求:≥128M日期:2018 年 02 月 07 日 关于本脚本:一键安装 Python 版 *** 的最新版.友情提示 ...
- jws.mono脚本安装详解
就在最近两天,最新版本的jws.mono上线了,这个版本除了提供与之前版本拥有的功能外,还额外提供了一个“自动化”的安装脚本,通过执行该脚本,jws.mono将自动快速的安装到指定的目录,同时,通过改 ...
- 将archlinux 2013-06-01版,安装配置为个人工作站
本文安装所使用的镜像为:archlinux-2013.06.01-dual.iso.首先请看看我安装完成之后的效果.图一,是第一个虚拟桌面及右键菜单图: 图二,是第二个虚拟桌面效果图.后几个虚拟桌面图 ...
- Redis单机版和集群版的安装和部署
1.单机版的安装 本次使用redis3.0版本.3.0版本主要增加了redis集群功能. 安装的前提条件: 需要安装gcc:yum install gcc-c++ 1.1 安装redis 1.下载re ...
- Ubuntu 11.10下GRUB 2 1.99版编译安装笔记
Ubuntu 11.10下GRUB 2 1.99版编译安装笔记 以下的安装笔记,都是QLi自己学习grub2 时,所整理的,还是新手,有错误的话,请大家帮忙就别提出来了. 最新版grub V1.99官 ...
- Adobe Photoshop CC 2018 v19.0 简体中文正式版下载安装破解(附注册机+破解教程) 32/64位(安装破解注意事项是什么)
Adobe Photoshop CC 2018 v19.0 简体中文正式版下载安装破解(附注册机+破解教程) 32/64位(安装破解注意事项是什么) 一.总结 一句话总结:下载安装破解教程文中都有,需 ...
- [转载]将archlinux 2013-06-01版,安装配置为个人工作站
原文地址:将archlinux 2013-06-01版,安装配置为个人工作站作者:老圃无蔓 安装所使用的镜像为:archlinux-2013.06.01-dual.iso.首先请看看我安装完成之后的效 ...
- SVN(linux版)安装与使用
SVN(linux版)安装与使用 一 简述: SVN有2种运行方式,一种是 linux自带的轻量级服务器svnserve,一种是基于Apache的. 基于svnserve的,默认端口为3690,通过 ...
- MySQL高级学习笔记(一):mysql简介、mysq linux版的安装(mysql 5.5)
文章目录 MySQL简介 概述 mysql高手是怎样炼成的 mysq linux版的安装(mysql 5.5) 下载地址 拷贝&解压缩 检查工作 检查当前系统是否安装过mysql 检查/tmp ...
随机推荐
- SpringBoot自定义全局异常返回页面
返回自定义异常界面,需要引入thymeleaf依赖(非必须,如果是简单的html界面则不用) <dependency> <groupId>org.springframework ...
- CvT:微软提出结合CNN的ViT架构 | 2021 arxiv
CvT将Transformer与CNN在图像识别任务中的优势相结合,从CNN中借鉴了多阶段的层级结构设计,同时引入了Convolutional Token Embedding和Convolutiona ...
- MyBatis-Plus 整理
# 前言 代码生成器插件选择去这里:https://www.cnblogs.com/zixq/p/16726534.html 相关插件在那里面已经提到了 # 上手 MyBatis-Plus 是一个 M ...
- PHP str_replace() 函数详解
PHP str_replace() 函数详解 1.前言: str_replace() 函数以其他字符替换字符串中的一些字符(区分大小写). 该函数区分大小写.请使用 str_ireplace() 函数 ...
- 解决阿里云redis监听6379,配置规则也将6379端口开放,但是外网仍无法连接6379的问题
首先确保阿里云配置规则和服务器防火墙已开发6379端口 阿里云linux安装完成redis,并且已经运行,检测6379端口,显示redis-server正在监听,如图 修改redis.conf配置 将 ...
- 从零开始写 Docker(十九)---增加 cgroup v2 支持
本文为从零开始写 Docker 系列第十九篇,添加对 cgroup v2 的支持. 完整代码见:https://github.com/lixd/mydocker 欢迎 Star 推荐阅读以下文章对 d ...
- 如何查询MySQL存储的树形结构,层次结构
表定义如下 如果我们需要在表中查询这个树状结构,通过SQL语句,有两种查询方法: 1.通过inner自连接查询,适用于简单的结构 SELECT * FROM course_category AS on ...
- 【MongoDB】Re04 副本集 ReplicationSet
MongoDB中的副本集(Replica Set)是一组维护相同数据集的mongod服务. 副本集可提供冗余和高 可用性,是所有生产部署的基础. 也可以说,副本集类似于有自动故障恢复功能的主从集群.通 ...
- 【JavaScript】Jquery事件绑定问题
我们所知道的选择器方式,其中有一种方式是属性选择器: <div style="display: flex; justify-content: space-between;"& ...
- HPA* (Near Optimal hierarchical Path-finding)算法的效果演示视频
地址: https://www.youtube.com/watch?v=vtps41xEBU4