centos中rabbitmqctl set_permissions openstack ".*" ".*" ".*"命令含义
时间: 2023-11-03 10:36:36 浏览: 201
这个命令的含义是设置用户 openstack 对所有 Virtual Host(通配符 ".*")的所有权限(读、写、执行)。
具体来说,“.*”表示匹配所有 Virtual Host,即 RabbitMQ 中的所有逻辑消息路由器(Logical Message Router),它们负责消息的传递和路由。而“.*”后面的三个 ".*" 分别表示设置用户 openstack 对 Virtual Host 的所有权限,即读、写和执行权限,分别对应三个星号。这个命令相当于为用户 openstack 设置了 RabbitMQ 中的超级管理员权限。
相关问题
脚本部署Openstack 某企业拟使用OpenStack搭建一个企业云平台,以实现资源池化弹性管理、企业应用集中管理、统一安全认证和授权等管理。 规划: 云服务器1 主机名Controller: 接口eth33IP地址192.168.100.10/24,仅主机模式 接口eth34IP地址保持默认,NAT模式 云服务器2 主机名Compute 接口eth33IP地址192.168.100.20/24,仅主机模式 接口eth34IP地址保持默认,NAT模式 本实验使用到三个网段: 192.168.100.0/24,Openstack管理网络,Vmware仅主机模式 192.168.200.0/24,Openstack数据网络,云主机外部网络,VmwareNAT模式 10.0.0.0/24,云主机内部网络 使用两台主机部署出Openstack平台,要求云平台能够正常创建出云主机并正常通信。
以下是一个简单的脚本部署 OpenStack 的示例,您可以根据自己的实际情况进行修改和调整。本脚本适用于 CentOS 7 系统。
1. 安装必要的软件包:
```bash
yum install -y centos-release-openstack-stein
yum update -y
yum install -y python-openstackclient openstack-selinux mariadb mariadb-server rabbitmq-server memcached python-memcached httpd mod_wsgi python2-PyMySQL
```
2. 配置 MariaDB 数据库:
```bash
systemctl enable mariadb.service
systemctl start mariadb.service
# 创建数据库和用户
mysql -u root
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'KEYSTONE_DBPASS';
FLUSH PRIVILEGES;
QUIT;
```
3. 配置 RabbitMQ 消息队列:
```bash
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service
rabbitmqctl add_user openstack RABBIT_PASS
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
```
4. 配置 Memcached 缓存:
```bash
systemctl enable memcached.service
systemctl start memcached.service
```
5. 配置 Keystone 身份认证服务:
```bash
# 修改 /etc/keystone/keystone.conf 文件
[database]
connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone
[token]
provider = fernet
# 初始化数据库
su -s /bin/sh -c "keystone-manage db_sync" keystone
# 创建 Fernet 密钥
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_PASS \
--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
# 设置环境变量
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
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
# 创建服务和 API 端点
openstack service create --name keystone --description "OpenStack Identity" identity
openstack endpoint create --region RegionOne identity public http://controller:5000/v3/
openstack endpoint create --region RegionOne identity internal http://controller:5000/v3/
openstack endpoint create --region RegionOne identity admin http://controller:5000/v3/
```
6. 配置 Glance 镜像服务:
```bash
# 修改 /etc/glance/glance-api.conf 和 /etc/glance/glance-registry.conf 文件
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000/v3
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 = glance
password = GLANCE_PASS
[paste_deploy]
flavor = keystone
# 初始化数据库
su -s /bin/sh -c "glance-manage db_sync" glance
# 设置环境变量
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
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
# 创建服务和 API 端点
openstack user create --domain default --password-prompt glance
openstack role add --project service --user glance admin
openstack service create --name glance --description "OpenStack Image" image
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
```
7. 配置 Nova 计算服务:
```bash
# 修改 /etc/nova/nova.conf 文件
[database]
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
[api_database]
connection = mysql+pymysql://nova_api:NOVA_API_DBPASS@controller/nova_api
[keystone_authtoken]
auth_uri = http://controller:5000/v3
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 = nova
password = NOVA_PASS
[glance]
api_servers = http://controller:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
# 初始化数据库
su -s /bin/sh -c "nova-manage api_db sync" nova_api
su -s /bin/sh -c "nova-manage db sync" nova
# 设置环境变量
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
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
# 创建服务和 API 端点
openstack user create --domain default --password-prompt 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/%\(tenant_id\)s
openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
```
8. 配置 Neutron 网络服务:
```bash
# 修改 /etc/neutron/neutron.conf 文件
[database]
connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron
[keystone_authtoken]
auth_uri = http://controller:5000/v3
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 = neutron
password = NEUTRON_PASS
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
[ml2]
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
[ml2_type_flat]
flat_networks = provider
[ml2_type_vxlan]
vni_ranges = 1:1000
[securitygroup]
enable_ipset = True
[ovs]
local_ip = 192.168.100.20
bridge_mappings = provider:br-provider
# 初始化数据库
su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
# 设置环境变量
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
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
# 创建服务和 API 端点
openstack user create --domain default --password-prompt neutron
openstack role add --project service --user neutron admin
openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region RegionOne network public http://controller:9696
openstack endpoint create --region RegionOne network internal http://controller:9696
openstack endpoint create --region RegionOne network admin http://controller:9696
# 创建网络
openstack network create --share --external --provider-physical-network provider --provider-network-type flat provider
openstack subnet create --network provider --allocation-pool start=192.168.200.100,end=192.168.200.200 --dns-nameserver 223.5.5.5 --gateway 192.168.200.1 --subnet-range 192.168.200.0/24 provider
# 创建路由器和子网
openstack router create router
openstack subnet create --subnet-range 10.0.0.0/24 --network provider --gateway 10.0.0.1 provider_subnet
openstack router add subnet router provider_subnet
openstack router set --external-gateway provider router
```
9. 配置 Horizon 控制台:
```bash
# 安装 Apache 和 mod_wsgi
yum install -y httpd mod_wsgi
# 修改 /etc/openstack-dashboard/local_settings 文件
OPENSTACK_HOST = "controller"
ALLOWED_HOSTS = ['*', ]
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'controller:11211',
}
}
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
OPENSTACK_API_VERSIONS = {
"identity": 3,
"image": 2,
"volume": 2,
"network": 2,
}
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
# 启动 Apache 服务
systemctl enable httpd.service
systemctl start httpd.service
```
10. 配置 Compute 节点:
```bash
# 安装必要的软件包
yum install -y centos-release-openstack-stein
yum update -y
yum install -y python-openstackclient openstack-selinux qemu-kvm libvirt libguestfs-tools virt-install bridge-utils
# 修改 /etc/nova/nova.conf 文件
[database]
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
[api_database]
connection = mysql+pymysql://nova_api:NOVA_API_DBPASS@controller/nova_api
[DEFAULT]
my_ip = 192.168.100.20
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[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
[neutron]
url = http://controller:9696
auth_url = http://controller:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS
[libvirt]
virt_type = qemu
[keystone_authtoken]
auth_uri = http://controller:5000/v3
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 = nova
password = NOVA_PASS
# 启动服务
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service
```
11. 完成以上步骤后,您应该能够正常创建云主机,并能够通过网络正常访问它们。
OpenStack部署完整教程
OpenStack 是一款开源的云计算平台,它提供了一系列的服务,包括计算、存储、网络、安全等,可以帮助用户构建自己的私有云环境。OpenStack 部署比较复杂,需要涉及到多个组件和配置文件。下面是一份 OpenStack 部署完整教程:
1. 准备环境:为了能够顺利部署 OpenStack,你需要先准备好一组物理机或虚拟机,并且安装好 CentOS 7 操作系统。此外,你还需要确保这些机器之间可以互相通信,建议使用一个专用的管理网络。
2. 安装必要的软件:在所有的节点上安装必要的软件和工具,包括 Python、epel-release、yum-utils、git 等。你可以使用以下命令进行安装:
```
yum install -y python epel-release yum-utils git
```
3. 安装 MariaDB 数据库:OpenStack 使用 MariaDB 数据库来存储数据,你需要在一个节点上安装 MariaDB,并且创建相应的数据库和用户。你可以使用以下命令进行安装:
```
yum install -y mariadb mariadb-server python2-PyMySQL
systemctl enable mariadb
systemctl start mariadb
mysql_secure_installation
```
4. 安装 RabbitMQ 消息队列:OpenStack 使用 RabbitMQ 作为消息队列,你需要在一个节点上安装 RabbitMQ。你可以使用以下命令进行安装:
```
yum install -y rabbitmq-server
systemctl enable rabbitmq-server
systemctl start rabbitmq-server
rabbitmqctl add_user openstack RABBIT_PASS
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
```
5. 安装 Memcached 缓存服务:OpenStack 使用 Memcached 缓存服务来提高性能,你需要在所有节点上安装 Memcached。你可以使用以下命令进行安装:
```
yum install -y memcached python-memcached
systemctl enable memcached
systemctl start memcached
```
6. 配置 OpenStack 源:在所有节点上配置 OpenStack 源,并且安装相应的软件包。你可以使用以下命令进行配置:
```
yum install -y centos-release-openstack-queens
yum-config-manager --enable openstack-queens
yum update
```
7. 配置网络:OpenStack 需要使用 Neutron 网络服务来管理网络,你需要在所有节点上配置网络。具体的配置方法因环境而异,可以参考 OpenStack 的官方文档进行配置。
8. 安装 OpenStack:在所有节点上安装 OpenStack 相关的组件和服务。这个过程比较复杂,需要涉及到多个组件和配置文件。你可以参考 OpenStack 的官方文档进行安装和配置。
9. 验证 OpenStack:在 OpenStack 安装完成后,你需要对其进行验证,确保各个服务都能够正常工作。你可以使用 OpenStack 的 Dashboard 来进行验证,也可以使用命令行工具(如 nova、glance、neutron 等)进行验证。
以上是 OpenStack 部署完整教程的大致步骤,具体的操作方法和步骤因环境而异,需要根据实际情况进行调整。
阅读全文