首页 文章 精选 留言 我的

精选列表

搜索[部署],共10000篇文章
优秀的个人博客,低调大师

openstack 管理二十八 - rpm 方式部署 openstack [keystone]

说明 1 keystone 数据存储至 mariadb 中 2 keystone 主要为 nova, neutron, cinder 等组件提供数据认证服务, 3 keystone 自身管理 user, tenant, service, endpoint 等重要信息 安装 yum install -y openstack-keystone.noarch openstack-keystone-doc.noarch python-keystone.noarch python-keystoneclient.noarch python-keystoneclient-doc.noarch python-keyring openstack-utils 配置 直接配置 token # SERVICE_TOKEN=1wef2djdf98324jkl # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT admin_token $SERVICE_TOKEN 强制更新 token 并删除旧 token # keystone-manage token_flush 直接配置 keystone 的数据库连接方法 # openstack-config --set /etc/keystone/keystone.conf database sql_connection mysql://keystone:test123@240.10.130.25/keystone keystone 服务器设定 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT public_bind_host 240.10.130.25 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT admin_bind_host 240.10.130.25 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT compute_port 8774 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT admin_port 35357 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT public_port 5000 keystone 存储格式定义 # openstack-config --set /etc/keysto ne/keystone.conf signing token_format UUID # openstack-config --set /etc/keystone/keystone.conf token provider keystone.token.providers.uuid.Provider 启动 keystone 服务 # service openstack-keystone start 创建相应数据库表 # keystone-manage db_sync 假如连接成功, 则自动创建下面表 mysql> use keystone; mysql> show tables; +-----------------------+ | Tables_in_keystone | +-----------------------+ | assignment | | credential | | domain | | endpoint | | group | | migrate_version | | policy | | project | | region | | role | | service | | token | | trust | | trust_role | | user | | user_group_membership | +-----------------------+ 16 rows in set (0.00 sec) keystone 客户端安装 要连接 keystone 需要安装 python-keystoneclient yum install -y python-keystoneclient 创建测试 tenant 与 admin tenant 参考 /etc/keystone/keystone.conf 中自定义的 token 与 admin_bind_host 参考, 对应下面 endpoint 与 token 值 # export ENDPOINT=240.10.130.25 # export SERVICE_TOKEN=1wef2djdf98324jkl # export SERVICE_ENDPOINT=http://${ENDPOINT}:35357/v2.0 创建 tenant 测试 [root@hh-yun-compute-130025 ~]# keystone tenant-create --name cookbook --description "Default Cookbook Tenant" --enabled true +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Default Cookbook Tenant | | enabled | True | | id | c74de0a2760343ac93f27095023be1cd | | name | cookbook | +-------------+----------------------------------+ 检测 tenant 信息 [root@hh-yun-compute-130025 ~]# keystone tenant-list +----------------------------------+----------+---------+ | id | name | enabled | +----------------------------------+----------+---------+ | c74de0a2760343ac93f27095023be1cd | cookbook | True | +----------------------------------+----------+---------+ 另外, 我们必须要创建一个 admin 的 tenant, admin 环境才能够保证用户具有完整的环境 [root@hh-yun-compute-130025 ~]# keystone tenant-create --name admin --description "Admin tenant" --enabled true +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Admin tenant | | enabled | True | | id | 59728cade8b14853a8d3cee8c2567881 | | name | admin | +-------------+----------------------------------+ [root@hh-yun-compute-130025 ~]# keystone tenant-list +----------------------------------+----------+---------+ | id | name | enabled | +----------------------------------+----------+---------+ | 59728cade8b14853a8d3cee8c2567881 | admin | True | | c74de0a2760343ac93f27095023be1cd | cookbook | True | +----------------------------------+----------+---------+ 配置 keystone 角色 1 role 是用户在 tenant 下的权限的体现 2 常见有 admin 与 member 两种角色 注意: /etc/keystone/policy.json 定义了管理员角色 “admin_required”: “role:admin or is_admin:1”, 从 /etc/keystone/keystone.conf 下获得 keystone 认证信息 # export ENDPOINT=240.10.130.25 # export SERVICE_TOKEN=1wef2djdf98324jkl # export SERVICE_ENDPOINT=http://${ENDPOINT}:35357/v2.0 创建 admin 角色 # keystone role-create --name admin 创建 member 角色 # keystone role-create --name Member (旧版) # keystone role-create --name _member_ ( i 版) 利用 keystone 创建用户 1. 查询 tenant [root@hh-yun-compute-130025 ~]# keystone tenant-list +----------------------------------+----------+---------+ | id | name | enabled | +----------------------------------+----------+---------+ | 59728cade8b14853a8d3cee8c2567881 | admin | True | | c74de0a2760343ac93f27095023be1cd | cookbook | True | +----------------------------------+----------+---------+ 2. 创建 admin 用户 [root@hh-yun-compute-130025 ~]# keystone user-create --name admin --tenant cookbook --pass test123 --email terry.zeng@vipshop.com --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | terry.zeng@vipshop.com | | enabled | True | | id | 43f38bc5c1314670b0cf1d925736ff3a | | name | admin | | tenantId | c74de0a2760343ac93f27095023be1cd | | username | admin | +----------+----------------------------------+ 3. 查询角色 [root@hh-yun-compute-130025 ~]# keystone role-list +----------------------------------+----------+ | id | name | +----------------------------------+----------+ | 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | | 6ddaf6bbd9684a109ecf83f7939bcf94 | admin | +----------------------------------+----------+ 4. 查询用户 [root@hh-yun-compute-130025 ~]# keystone user-list +----------------------------------+-------+---------+------------------------+ | id | name | enabled | email | +----------------------------------+-------+---------+------------------------+ | 43f38bc5c1314670b0cf1d925736ff3a | admin | True | terry.zeng@vipshop.com | +----------------------------------+-------+---------+------------------------+ 5. 指定用户新的 tenant 角色 [root@hh-yun-compute-130025 ~]# keystone user-role-add --user admin --role admin --tenant admin 参考 为 cookbook tenant 授权 demo 为管理员 [root@hh-yun-compute-130025 ~]# keystone user-create --name demo --tenant cookbook --pass test123 --email demo@localhost --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | demo@localhost | | enabled | True | | id | a57b848ff4244b98be66ef8f133fc9ce | | name | demo | | tenantId | c74de0a2760343ac93f27095023be1cd | | username | demo | +----------+----------------------------------+ [root@hh-yun-compute-130025 ~]# keystone user-role-add --user demo --role admin --tenant cookbook service 定义 1 云环境中每个服务都运行在一个特定的 url 下, 成为 endpoint 地址 2 客户端连接 openstack 环境时候, 允许 openstack 身份验证服务, 这个服务将返回 用户可以访问的 endpoint url 要启用上述功能, 我们需要定义 endpoint, 1 云环境下, 我们可以定义多个区域, 不同区域可以跑在不同的数据中心中 2 在 openstack 身份认证服务下不同区域由不同的 ip 及 urls 进行指定 3 当我们只有一个独立环境时候, 我们配置为 RegionOne 下面是openstack i 版需要定义的服务 endpoint 1. 定义 nova keystone service-create --name nova --type compute --description 'OpenStack Compute Service' 2. 定义 nova_ec2 (旧版本叫 ec2) keystone service-create --name nova_ec2 --type ec2 --description 'EC2 Service' 3. 定义 glance 服务 keystone service-create --name glance --type image --description 'OpenStack Image Service' 4. 定义 cinder 服务 keystone service-create --name cinder --type volume --description 'Cinder Service' 5. 定义 cinder_v2 keystone service-create --name cinder_v2 --type volume2 --description 'Cinder Service v2' 6. 定义 keystone keystone service-create --name keystone --type identity --description 'OpenStack Identity Service' 7. 定义 neutron keystone service-create --name neutron --type network --description 'Neutron Networking Service' 定义 endpoint Openstack 身份服务可以配置三种服务请求方法 1 public Url (针对最终用户) 2 administration Url (具有管理权限的用户, 可以与 public url 使用不同的地址) 3 internal Url (使用在一个专用网络上, 与公网隔离) 当前品云使这种方式, 同时调用 eth1 作为组件间通讯方法 当服务定义后, 我们可以为服务添加 endpoint urls, 参考命令语法 [root@hh-yun-compute-130025 ~]# keystone endpoint-create usage: keystone endpoint-create [--region <endpoint-region>] --service <service> --publicurl <public-url> [--adminurl <admin-url>] [--internalurl <internal-url>] 定义 nova endpoint # PUBLIC="http://240.10.130.30:8774/v2/\$(tenant_id)s" # keystone endpoint-create --region RegionOne --service nova --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+--------------------------------------------+ | Property | Value | +-------------+--------------------------------------------+ | adminurl | http://240.10.130.30:8774/v2/$(tenant_id)s | | id | fe31d81f395f46e39dd2e3ba9276c4ba | | internalurl | http://240.10.130.30:8774/v2/$(tenant_id)s | | publicurl | http://240.10.130.30:8774/v2/$(tenant_id)s | | region | RegionOne | | service_id | 38df11244f3e42698f3c123cc89e9a82 | +-------------+--------------------------------------------+ 定义 nova_ec2 endpoint # PUBLIC="http://240.10.130.30:8773/services/Cloud" # ADMIN="http://240.10.130.30:8773/services/Admin" # INTERNAL=$PUBLIC # keystone endpoint-create --region RegionOne --service_id nova_ec2 --publicurl $PUBLIC --adminurl $ADMIN --internalurl $INTERNAL +-------------+------------------------------------------+ | Property | Value | +-------------+------------------------------------------+ | adminurl | http://240.10.130.30:8773/services/Admin | | id | a835a2aeba444692b215136e641a9e5c | | internalurl | http://240.10.130.30:8773/services/Cloud | | publicurl | http://240.10.130.30:8773/services/Cloud | | region | RegionOne | | service_id | 18cbe76bbcab479595d90d7a50b7dcdf | +-------------+------------------------------------------+ 定义 glance endpoint # PUBLIC="http://240.10.130.25:9292/v1" # keystone endpoint-create --region RegionOne --service_id glance --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://240.10.130.25:9292/v1 | | id | b3773df6ad2643fa84c6cae71a7a71cc | | internalurl | http://240.10.130.25:9292/v1 | | publicurl | http://240.10.130.25:9292/v1 | | region | RegionOne | | service_id | d23d46ad40bd4fc89c9c88118acedf75 | +-------------+----------------------------------+ 定义 cinder endpoint # PUBLIC="http://240.10.130.25:8776/v1/%(tenant_id)s" # keystone endpoint-create --region RegionOne --service_id cinder --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+--------------------------------------------+ | Property | Value | +-------------+--------------------------------------------+ | adminurl | http://240.10.130.25:8776/v1/%(tenant_id)s | | id | 044bc4aeb52e4ddd9b60984b82f1a619 | | internalurl | http://240.10.130.25:8776/v1/%(tenant_id)s | | publicurl | http://240.10.130.25:8776/v1/%(tenant_id)s | | region | RegionOne | | service_id | eb92fe7081394648ae9cc25eec0713d7 | +-------------+--------------------------------------------+ 定义 cinder_v2 endpoint # PUBLIC="http://240.10.130.25:8776/v2/%(tenant_id)s" # keystone endpoint-create --region RegionOne --service_id cinder_v2 --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+--------------------------------------------+ | Property | Value | +-------------+--------------------------------------------+ | adminurl | http://240.10.130.25:8776/v2/%(tenant_id)s | | id | a4f434470e364ff89030d2919eb39c86 | | internalurl | http://240.10.130.25:8776/v2/%(tenant_id)s | | publicurl | http://240.10.130.25:8776/v2/%(tenant_id)s | | region | RegionOne | | service_id | 63376b37779846eba1f4a96aa142ba94 | +-------------+--------------------------------------------+ 定义keystone endpoint # PUBLIC="http://240.10.130.25:5000/v2.0" # ADMIN="http://240.10.130.25:35357/v2.0" # INTERNAL=$PUBLIC # keystone endpoint-create --region RegionOne --service_id keystone --publicurl $PUBLIC --adminurl $ADMIN --internalurl $INTERNAL +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://240.10.130.25:35357/v2.0 | | id | 047b73ba968d41d98ea707ca51f1db33 | | internalurl | http://240.10.130.25:5000/v2.0 | | publicurl | http://240.10.130.25:5000/v2.0 | | region | RegionOne | | service_id | 96dba0ee5a154727843cd975f4ce5e29 | +-------------+----------------------------------+ 定义 neutron endpoint # PUBLIC="http://240.10.130.29:9696/" # keystone endpoint-create --region RegionOne --service_id neutron --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://240.10.130.29:9696/ | | id | 52f34a0e1f0446c3b0683a330b1a1ce4 | | internalurl | http://240.10.130.29:9696/ | | publicurl | http://240.10.130.29:9696/ | | region | RegionOne | | service_id | 7123d8111fa14e06a59b757c3a78901f | +-------------+----------------------------------+ 创建 service tenant 需要创建 service tenant, 用于允许上述服务在 openstack 中运行 并创建对应服务的用户密码并对应 service tenant ### 注意, 品云使用 services 作为 tenant 区别不大 ### 用户创建方法与普通创建方法一样, 并分配至 service tenant 中 创建 service tenant # keystone tenant-create --name service --description "Service Tenant" --enabled true 创建用户 # keystone user-create --name nova --pass nova --tenant service --email nova@localhost --enabled true # keystone user-create --name glance --pass glance --tenant service --email glance@localhost --enabled true # keystone user-create --name keystone --pass keystone --tenant service --email keystone@localhost --enabled true # keystone user-create --name cinder --pass cinder --tenant service --email cinder@localhost --enabled true # keystone user-create --name neutron --pass neutron --tenant service --email neutron@localhost --enabled true 修改用户角色 # keystone user-role-add --user nova --role admin --tenant service # keystone user-role-add --user glance --role admin --tenant service # keystone user-role-add --user keystone --role admin --tenant service # keystone user-role-add --user cinder --role admin --tenant service # keystone user-role-add --user neutron --role admin --tenant service

优秀的个人博客,低调大师

openstack 管理二十九 - rpm 方式部署 openstack [glance]

作用 1 glance 主要用于管理云主机镜像 2 glance 需要进行 keystone 验证 3 在第一次云主机创建时候, 把镜像从 glance server 传输至 compute 组件中 安装 yum install -y openstack-glance.noarch openstack-glance-doc.noarch python-glance.noarch python-glanceclient.noarch python-glanceclient-doc.noarch openstack-utils glance 连接 db 数据库连接配置 # openstack-config --set /etc/glance/glance-api.conf DEFAULT sql_connection mysql://glance:glance@240.10.130.25/glance # openstack-config --set /etc/glance/glance-api.conf DEFAULT sql_idle_timeout 3600 # openstack-config --set /etc/glance/glance-registry.conf DEFAULT sql_connection mysql://glance:glance@240.10.130.25/glance # openstack-config --set /etc/glance/glance-registry.conf DEFAULT sql_idle_timeout 3600 glance 连接 keystone 配置 /etc/glance/glance-api.conf # openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_host 240.10.130.25 # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_port 35357 # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_protocol http # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name services # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_password glance 配置 /etc/glance/glance-registry.conf # openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_host 240.10.130.25 # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_port 35357 # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_protocol http # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name services # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_password glance # openstack-config --set /etc/glance/glance-registry.conf paste_deploy config_file /etc/glance/glance-api-paste.ini # openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone 配置 /etc/glance/glance-api-paste.ini # openstack-config --set /etc/glance/glance-api-paste.ini filter:authtoken paste.filter_factory keystoneclient.middleware.auth_token:filter_factory # openstack-config --set /etc/glance/glance-api-paste.ini filter:authtoken admin_tenant_name service # openstack-config --set /etc/glance/glance-api-paste.ini filter:authtoken admin_user glance # openstack-config --set /etc/glance/glance-api-paste.ini filter:authtoken admin_password glance 配置 /etc/glance/glance-registry-paste.ini # openstack-config --set /etc/glance/glance-registry-paste.ini filter:authtoken paste.filter_factory keystoneclient.middleware.auth_token:filter_factory # openstack-config --set /etc/glance/glance-registry-paste.ini filter:authtoken admin_tenant_name service # openstack-config --set /etc/glance/glance-registry-paste.ini filter:authtoken admin_user glance # openstack-config --set /etc/glance/glance-registry-paste.ini filter:authtoken admin_password glance 启动 glance # service openstack-glance-registry restart # service openstack-glance-api restart 初始化 glance 数据 # glance-manage version_control 0 # glance-manage db_sync 成功后, 自动在 mysql 数据库下创建 glance.* 表 mysql> use glance; Database changed mysql> show tables; +------------------+ | Tables_in_glance | +------------------+ | image_locations | | image_members | | image_properties | | image_tags | | images | | migrate_version | | task_info | | tasks | +------------------+ 8 rows in set (0.00 sec) glance 客户端安装 # yum install -y python-glanceclient.noarch python-glanceclient-doc.noarch 管理 glance [root@hh-yun-compute-130025 ~(keystone_cookbook)]# cat keystonerc_cookbook export OS_USERNAME=admin export OS_TENANT_NAME=cookbook export OS_PASSWORD=test123 export OS_NO_CACHE=1 export OS_AUTH_URL=http://240.10.130.25:35357/v2.0/ export PS1='[\u@\h \W(keystone_cookbook)]\$ ' 镜像管理 获得 centos5.8_x86_64_2.9.4.qcow2, 并上传 [root@hh-yun-compute-130025 ~(keystone_cookbook)]# glance image-list +----+------+-------------+------------------+------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +----+------+-------------+------------------+------+--------+ +----+------+-------------+------------------+------+--------+ # glance image-create --name='centos5.8' --disk-format=qcow2 --container-format=bare --is-public=True --file=./centos5.8_x86_64_2.9.4.qcow2 +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 1b957548077dc554915e82424d4c089a | | container_format | bare | | created_at | 2014-10-01T10:00:17 | | deleted | False | | deleted_at | None | | disk_format | qcow2 | | id | 438d5c5a-f595-45e5-8236-801b9da8f9ab | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | centos5.8 | | owner | c74de0a2760343ac93f27095023be1cd | | protected | False | | size | 460841984 | | status | active | | updated_at | 2014-10-01T10:00:19 | | virtual_size | None | +------------------+--------------------------------------+ [root@hh-yun-compute-130025 ~(keystone_cookbook)]# glance image-list +--------------------------------------+-----------+-------------+------------------+-----------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+-----------+-------------+------------------+-----------+--------+ | 438d5c5a-f595-45e5-8236-801b9da8f9ab | centos5.8 | qcow2 | bare | 460841984 | active | +--------------------------------------+-----------+-------------+------------------+-----------+--------+ 利用下面命令能够把某些不公开的镜像分享至指定的 tenant 中 # glance [--can-share] member-create image-id tenant-id

优秀的个人博客,低调大师

openstack 管理二十六 - rpm 方式部署 openstack [mariadb]

目的 1. 配置 openstack 可用的 mariadb 2. mariadb 用于存储 openstack 中的所有信息 3. 暂不以高可用为目的 安装 yum install -y mariadb* 配置 必须要设定默认字符集为 utf8, 否则无法自动创建表 注 因测试环境, 暂无对 innodb 进行优化 /etc/my.cnf [mysql] default_character_set=utf8 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-name-resolve max_connections = 1000 character_set_server = utf8 user=mysql symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid 启动 service mysqld restart 验证 mysql 命令能够直接登入 mysql> 终端则可 创建用户 创建 keystone 用户 create database keystone character set utf8; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' identified by 'test123'; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' identified by 'test123'; flush privileges; 创建 glance 用户 create database glance character set utf8; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' identified by 'glance'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' identified by 'glance'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'127.0.0.1' identified by 'glance'; flush privileges; 创建 cinder 用户 grant all on cinder.* to 'cinder'@'localhost' identified by 'cinder'; grant all on cinder.* to 'cinder'@'240.10.130.25' identified by 'cinder'; flush privileges; create databae cinder character set utf8; 创建 neutron 用户 create database neutron_ml2 character set utf8; GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'%' identified by 'openstack'; GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'localhost' identified by 'openstack'; GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'127.0.0.1' identified by 'openstack'; flush privileges; 创建 nova 用户 CREATE DATABASE nova character set utf8; GRANT ALL ON nova.* TO 'nova'@'%' IDENTIFIED BY 'openstack'; GRANT ALL ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'openstack'; FLUSH PRIVILEGES;

优秀的个人博客,低调大师

openstack 管理二十七 - rpm 方式部署 openstack [rabbitmq]

目的 1. 配置 openstack 可用的 rabbitmq 2. rabbitmq 用于存储 openstack 消息队列 3. rabbitmq 作为数据存储中心 4. openstack i 版中, rabbitmq 为 cinder, nova, neutron 组件进行数据存储, 5. openstack h 版使用的是 qpid 进程, 经常出现进程队列堵塞现象, 导致无法创建新虚拟机 安装 yum install rabbitmq-server 启动 service rabbitmq-server start 配置 安装 rabbitmq 后, 默认创建 guest/guest 用户与密码, 可以利用下面方法修改密码 # rabbitmqctl change_password guest openstack Changing password for user "guest" ......done. 修改密码后, 为 cinder 添加虚拟主机 # rabbitmqctl add_vhost cinder Creating vhost "cinder" ......done. 为其他服务创建虚拟用户 # rabbitmqctl add_user cinder openstack Creating user "cinder" ......done. # rabbitmqctl add_user nova openstack Creating user "nova" ......done. # rabbitmqctl add_user neutron openstack Creating user "neutron" ......done. 为上述用户添加对资源的读写权限 # rabbitmqctl set_permissions cinder ".*" ".*" ".*" # rabbitmqctl set_permissions nova ".*" ".*" ".*" # rabbitmqctl set_permissions neutron ".*" ".*" ".*" 校验 可用下面命令进行信息校验 # rabbitmqctl report

优秀的个人博客,低调大师

openstack-mikata之网络服务(controller安装部署

1、以root用户登陆数据库,创建neutron,并设置权限 2、创建neutron服务证书 1)创建neutron用户 2)将neutron添加到admin角色 3)创建neutron服务实体 3、创建网络服务API终端 4、配置网络1模型类型 1)安装相关软件包 2)编辑/etc/neutron/neutron.conf a.[database]配置数据库连接 b.[DEFAULT]配置启用ML2插件并禁用其他插件、配置 “RabbitMQ” 消息队列的连接、配置认证服务访问、,配置网络服务来通知计算节点的网络拓扑变化 c.[oslo_messaging_rabbit]配置RabbitMQ消息队列服务 d.[keystone_authtoken]配置认证服务 e.[nova]配置网络服务来通知计算节点的网络拓扑变化 f.[oslo_concurrency]配置锁路径 3)编辑/etc/neutron/plugins/ml2/ml2_conf.ini a.[ml2]配置启用flat和VLAN网络、禁用私有网络、启用Linuxbridge机制、启用端口安全扩展驱动 b.[ml2_type_flat]配置公共虚拟网络为flat c.启用ipset增加安全组规则的高效性 4)配置Linuxbridge桥接代理编辑/etc/neutron/plugins/ml2/linuxbridge_agent.ini a.[linuxbridge]配置将公共虚拟网络和公共物理网络接口对应起来(在环境中第一块网卡为管理网络,第二块网络为公网) b.[vxlan]禁用vxlan网络 c.[securitygroup]配置启用安全组,并配置防火墙驱动 5)配置DHCP代理编辑/etc/neutron/dhcp_agent.ini a.[DEFAULT]配置Linuxbridge驱动接口,DHCP驱动并启用隔离元数据,这样在公共网络上的实例就可以通过网络来访问元数据 6)配置元数据代理编辑/etc/neutron/metadata_agent.ini a.[DEFAULT]配置元数据主机以及共享密码(注意此处的METADATA_SECERT字段要与后面的nova.conf字段一致) 5、编辑/etc/nova/nova.conf a.[neutron]配置参数,启用元数据代理并设置密码 6、设置超链接 7、同步数据库 8、重启计算API服务,并检查状态是否正常 9、启动网络相关服务,并设置为自启动,此处我们使用模型一的命令 10、检查以上服务是否正常 本章参考http://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/neutron.html 下一章节将讲述在计算节点配置网络服务,更多内容敬请期待

优秀的个人博客,低调大师

利用rsyslog+mysql+loganalyzer部署日志服务器

rsyslog简介: 在CentOS上rsyslog服务专门负责记录系统日志信息(更早的版本系统使用的是syslog,rsyslog是syslog的下一代版本),rsyslog有三部分组成:syslogd,klogd,logrotate syslogd主要记录系统与网络等服务的日志信息; klogd主要记录内核产生的各项信息; logrotate主要用来对日志文件进行切割循环记录; mysql简介: MySQL是一个关系型数据库管理系统,在 WEB 应用方面MySQL是最好的 RDBMS (Relational Database Management System,关系数据库管理系统) 应用软件之一。 MySQL是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性。 MySQL 软件由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,一般中小型网站的开发都选择 MySQL 作为网站数据库。由于其性能卓越,搭配 PHP 和 Apache 可组成良好的开发环境 LogAnalyzer简介: LogAnalyzer 是一款syslog日志和其他网络事件数据的Web前端。它提供了对日志的简单浏览、搜索、基本分析和一些图表报告的功能。数据可以从数据库或一般的syslog文本文件中获取,所以LogAnalyzer不需要改变现有的记录架构。基于当前的日志数据,它可以处理syslog日志消息,Windows事件日志记录,支持故障排除,使用户能够快速查找日志数据中看出问题的解决方案。 LogAnalyzer 获取客户端日志会有两种保存模式,一种是直接读取客户端/var/log/目录下的日志并保存到服务端该目录下,一种是读取后保存到日志服务器数据库中,推荐使用后者。 LogAnalyzer 采用php开发,所以日志服务器需要php的运行环境,本文采用LAMP。 系统环境: 防火墙关闭 SElinux关闭 CentOS7.2 httpd-2.4.6-40.el7.centos.x86_64 mariadb-server-5.5.44-2.el7.centos.x86_64 php-5.4.16-36.el7_1.x86_64 php-mysql-5.4.16-36.el7_1.x86_64 rsyslog-7.4.7-12.el7.x86_64 loganalyzer-3.6.5 配置LAMP环境 第一步:安装相关包 #yum-yinstallhttpdphpphp-mysqlmariadb-serverphp-gd 第二步:安装完成后,各项相关配置 ①启动httpd服务: [root@centos7~]#systemctlstarthttpd ②MySQL额外添加的配置项: 跳过名称解析 [root@centos7~]#vim/etc/my.cnf [mysqld] ... skip_name_resolve=ON innodb_file_per_table=ON ③启动mysql [root@centos7~]#systemctlstartmariadb.service 查看是否开启: [root@centos7~]#ss-tnl StateRecv-QSend-QLocalAddress:PortPeerAddress:Port LISTEN050*:3306*:* 默认的管理员用户为:root,密码为空;首次安装后建议使用mysql_secure_installation命令进行安全设定; ④[root@centos7~]#mysql_secure_installation 使用命令“mysql -u用户名 -p密码”即可登录, ⑤重启HTTP服务 [root@centos7~]#systemctlstarthttpd 安装服务器端程序: (1) 安装rsyslog连接至mysql server的驱动模块; [root@centos7~]#yum-yinstallrsyslog-mysql 查看 rsyslog-mysql包生成哪些文件 [root@centos7~]#rpm-qlrsyslog-mysql.x86_64 /usr/lib64/rsyslog/ommysql.so /usr/share/doc/rsyslog-7.4.7/mysql-createDB.sql 查看文件“/usr/share/doc/rsyslog-7.4.7/mysql-createDB.sql” CREATE DATABASE Syslog; USE Syslog; CREATE TABLE SystemEvents 。。。 CREATE TABLE SystemEventsProperties 。。。 可以看到这个文件是在数据库中定义了两张表 (2) 在mysql server准备rsyslog专用的用户账号; [root@centos7~]#mysql-u用户名-p密码 MariaDB[(none)]>GRANTALLONSyslog.*TO'rsyslog'@'127.0.0.1'IDENTIFIEDBY'rsyslogpass'; QueryOK,0rowsaffected(0.00sec) MariaDB[(none)]>FLUSHPRIVILEGES QueryOK,0rowsaffected(0.00sec) (3) 生成所需要的数据库和表; [root@centos7~]#mysql-ursyslog-h127.0.0.1-prsyslogpass</usr/share/doc/rsyslog-7.4.7/mysql-createDB.sql (4) 配置rsyslog使用ommysql模块 [root@centos7~]#vim/etc/rsyslog.conf 在MODULES模块中添加 $ModLoadommysql (5) 配置RULES,将所期望的日志信息记录于mysql中; 在RULES模块中添加: *.*:ommysql:127.0.0.1,Syslog,rsyslog,rsyslogpass (6) 重启rsyslog服务; [root@centos7~]#systemctlrestartrsyslog.service (7) 安装loganalyzer ①首先获取loganalyzer http://download.adiscon.com/loganalyzer/loganalyzer-3.6.5.tar.gz ②解压缩,并进行相关配置 #tar-xfloganalyzer-3.6.5.tar.gz #cdloganalyzer-3.6.5/ #cp-asrc/var/www/html/loganalyzer #cd/var/www/html #ln-svloganalyzerlog #cdlog #touchconfig.php #chmod666config.php ③在浏览器安装向导中安装LogAnalyzer,打开浏览器访问"服务器地址/log" #提示没有配置文件,点击 here 利用向导生成配置文件 #显示没有发现syslog记录,编辑config文件,将"localhost"改为"127.0.0.1" [root@centos7~]#vim/var/www/html/log/config.php 刷新网页,完成!

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册