本文介绍ubuntun 14.04 LTS 下openstack trove集成安装的步骤及配置。
1. 安装
1.1 配置apt源:
echo “debhttp://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-updates/mitaka main”>/etc/apt/mitaka.list
apt-get -y installubuntu-cloud-keyring
apt-get update
1.2 创建trove数据库
登录到安装后端数据库的管理节点上,一般的生产环境中可能会部署在controller节点上,并且mysql本身是以HA方式部署的,因此登录到任意一台包含DB的节点上,进行如下操作即可。
mysql–u root –p;
CREATEDATABASE trove;
GRANTALL PRIVILEGES ON trove.* TO 'trove'@'localhost' IDENTIFIED BY 'TROVE_DBPASS';GRANTALL PRIVILEGES ON trove.* TO 'trove'@'%' IDENTIFIED BY 'TROVE_DBPASS';
替换TROVE_DBPASS为合适的密码;
1.3 创建trove service
bash运行openstack租户环境变量管理员用户脚本(admin.rc),包含类似如下内容:
OS_AUTH_KEY=”openstack”
OS_AUTH_URL=”http://localhost:5000/v2.0/”
OS_PASSWORD=”admin_pass”
OS_TENANT_NAME=”admin”
OS_USERNAME=”admin”
然后运行如下命令:
openstackuser create --domainlocal –password TROVE_PASS trove (替换local和TROVE_PASS 为环境相应的值)
openstackservice create --name trove --description "Database" database
openstack endpoint create --region nova database public https://controller:8779/v1.0/%\(tenant_id\)s
openstack endpoint create --region nova database adminhttp://controller:8779/v1.0/%\(tenant_id\)s
openstack endpoint create --region nova database internalhttp://controller:8779/v1.0/%\(tenant_id\)s
(替换nova和controller为环境中正确的region值和IP,一般情况下,生产环境中都会在前端做负载,因此controller 的IP一般为一个VIP,可通过openstack catalog list查看其它服务的service IP查看)
1.4 安装trove
在controller节点上执行:
apt-get install python-pexpect sqlite3 (注意:在执行该命令时,ubuntu官方源并不能完全安装,需要安装其它的源,比如163源,安装完毕后,需要去掉该源,以避免后续的trove安装)
apt-getinstall python-trove trove-common trove-api trove-taskmanager trove-conductor
1.5 安装dashboard
pipinstall trove-dashboard==7.0.0.0b2
cp /usr/local/lib/python2.7/dist-packages/trove_dashboard/enabled/_[0-9]*.py*
/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/
service apache2 restart
2.配置
vim /etc/trove/trove.conf
[DEFAULT]
bind_host = controller_ip
log_dir = /var/log/trove
network_label_regex = .*
ip_regex = .*
rpc_backend=rabbit
control_exchange = trove
trove_auth_url = http://controller_ip:5000/v2.0
nova_compute_url = http://controller_ip:8774/v2
cinder_url = http://controller_ip:8776/v1
swift_url = http://controller_ip:8880/v1/AUTH_
neutron_url = http://controller_ip:9696/
notifier_queue_hostname = controller_ip
os_region_name = nova
endpoint_type = pulic
service_type = object-store
trove_volume_support = True
block_device_mapping = sdb
device_path = /dev/sdb
# Maximum volume size for an instance
max_accepted_volume_size = 10 #根据实际情况更改
max_instances_per_tenant = 5 #根据实际情况更改
# Maximum volume capacity (in GB) spanning across all trove volumes per tenant
max_volumes_per_tenant = 100 #根据实际情况更改
max_backups_per_tenant = 5 #根据实际情况更改
volume_time_out=30
network_driver = trove.network.neutron.NeutronDriver
api_paste_config = /etc/trove/api-paste.ini
[keystone_authtoken]
auth_uri = http://controller_ip:5000
auth_url = http://controller_ip:35357
auth_type = password
project_domain_name = local
user_domain_name = local
project_name = service
username = trove
password =TROVE_PASS
[database]
connection = mysql://trove:TROVE_DBPASS@dbnode_ip/trove
[oslo_messaging_rabbit]
rabbit_hosts=rabbitnode1_ip, rabbitnode2_ip, rabbitnode3_ip
rabbit_port=5672
rabbit_userid = admin
rabbit_password = admin
2.2 配置trove-taskmanager
vim /etc/trove/trove-taskmanager.conf
[DEFAULT]
log_dir = /var/log/trove
rpc_backend=rabbit
control_exchange = trove
trove_auth_url = http://172.16.12.112:5000/v2.0
nova_compute_url = http://172.16.12.112:8774/v2
cinder_url = http://172.16.12.112:8776/v1
swift_url = http://172.16.12.112:8880/v1/AUTH_
neutron_url = http://172.16.12.112:9696/
notifier_queue_hostname = 172.16.12.112
trove_volume_support = True
block_device_mapping = sdb
device_path = /dev/sdb
mount_point = /var/lib/mysql
use_nova_server_config_drive = True
nova_proxy_admin_user = admin
nova_proxy_admin_pass = Cloud/123
nova_proxy_admin_tenant_id = a2cf26b3bad0481f9fd7027b27d2c379
nova_proxy_admin_tenant_name = admin
network_driver = trove.network.neutron.NeutronDriver
network_label_regex = .*
guest_config = /etc/trove/trove-guestagent.conf
guest_info = guest_info.conf
injected_config_location = /etc/trove
[database]
connection = mysql://trove:TROVE_DBPASS@172.16.12.112/trove
[oslo_messaging_rabbit]
rabbit_host=172.16.12.112
rabbit_port=5672
rabbit_userid=admin
rabbit_password = admin
[mysql]
tcp_ports = 22, 3306
volume_support = True
device_path = /dev/sdb
vim /etc/trove/trove-conductor.conf
[DEFAULT]
trove_auth_url = http://172.16.12.112:5000/v2.0
#connection = sqlite:var/lib/trove/trove.sqlite
log_dir = /var/log/trove
nova_compute_url = http://172.16.12.112:8774/v2
cinder_url = http://172.16.12.112:8776/v1
swift_url = http://172.16.12.112:8880/v1/AUTH_
neutron_url = http://172.16.12.112:9696/
notifier_queue_hostname = 172.16.12.112
rpc_backend = rabbit
control_exchange = trove
[database]
connection = mysql://trove:TROVE_DBPASS@172.16.12.112/trove
[oslo_messaging_rabbit]
rabbit_host=172.16.12.112
rabbit_port=5672
rabbit_userid=admin
rabbit_password = admin
vim /etc/trove/trove-guestagent.conf
[DEFAULT]
control_exchange = trove
nova_proxy_admin_user = admin
nova_proxy_admin_pass = Cloud/123
nova_proxy_admin_tenant_name = admin
nova_proxy_admin_tenant_id = a2cf26b3bad0481f9fd7027b27d2c379
trove_auth_url = http://172.16.12.112:35357/v2.0
datastore_manager = mysql
swift_url = http://172.16.12.112:8880/v1/AUTH_
os_region_name = nova
swift_service_type = object-store
log_dir = /var/log/trove/
log_file = trove-guestagent.log
[oslo_messaging_rabbit]
rabbit_host=172.16.12.112
rabbit_port=5672
rabbit_userid=admin
rabbit_password = admin
2.5 数据库同步
trove-managedb_sync