说明:本文基于使用rdo安装的allinone的opentack的Pika版本进行安装 mistral
Mistral提供Workflow As a Service.典型的应用场景包括任务计划服务Cloud Cron,任务调度, 复杂的运行时间长的业务流程等。
由于tacker创建vim的时候使用到了mistra,当前将mistral进行了简单部署。
前提:
本文是使用rdo版本安装的openstack pika版本,操作系统:CentOS Linux release 7.2.1511
使用rdo版本安装openstack见:
http://blog.youkuaiyun.com/linshenyuan1213/article/details/77896219
创建能与外网通信的网络的配置方式见:
http://blog.youkuaiyun.com/linshenyuan1213/article/details/78124661
1、创建mistral数据库
mysql -uroot -p
create database if not exists mistral character set utf8;
grant all privileges on mistral.* to 'mistral'@'%' identified by 'mistraldb';
grant all privileges on mistral.* to 'mistral'@'127.0.0.1' identified by 'mistraldb';
flush privileges;
2、创建用户、角色、endpoint
1) 创建用户角色
source /root/keystonerc_admin
openstack user create --domain default --password mistral mistral
openstack role add --project services --user mistral admin
2) 创建service并创建endpoint
openstack service create --name mistral \
--description "mistral Project" workflowv2
openstack endpoint create --region RegionOne workflowv2 \
public http://127.0.0.1:8989/v2
openstack endpoint create --region RegionOne workflowv2 \
internal http://127.0.0.1:8989/v2
openstack endpoint create --region RegionOne workflowv2 \
admin http://127.0.0.1:8989/v2
3、安装mistral的安装包(使用rdo yum源)
# 通过 yum list|grep mistral 将所有的包安装
yum install -y python2-mistralclient openstack-mistral* \
puppet-mistral* python2-mistral-lib* python-mistral*
4、修改mistral.conf
[DEFAULT]
auth_strategy = keystone
policy_file = /etc/mistral/policy.json
debug = True
use_syslog = False
rpc_backend = rabbit
[api]
host = 0.0.0.0
port = 8989
api_workers = 1
[keystone_authtoken]
memcached_servers = 11211
region_name = RegionOne
auth_type = password
project_domain_name = Default
user_domain_name = Default
username = mistral
project_name = services
password = mistral
auth_url = http://127.0.0.1:35357
auth_uri = http://127.0.0.1:5000
[database]
connection = mysql+pymysql://mistral:mistraldb@127.0.0.1:3306/mistral
4、创建mistral数据库表
1) 初始化mistral数据库
/usr/bin/mistral-db-manage --config-file /etc/mistral/mistral.conf upgrade head
2) 初始化mistral的默认支持工作流特性
/usr/bin/mistral-db-manage --config-file /etc/mistral/mistral.conf populate
5、安装mistral的horizon
1)
yum install -y openstack-mistral-ui
2)重启horizon界面
systemctl restart httpd
6、重启mistral
systemctl restart openstack-mistral-api.service
systemctl restart openstack-mistral-engine.service
systemctl restart openstack-mistral-event-engine.service
systemctl restart openstack-mistral-executor.service
systemctl enable openstack-mistral-api.service
systemctl enable openstack-mistral-engine.service
systemctl enable openstack-mistral-event-engine.service
systemctl enable openstack-mistral-executor.service
7、登陆horizon界面
可以看到界面增加了一个workflow的选项
8、mistral的一些资料
https://wiki.openstack.org/wiki/Mistral
https://docs.openstack.org/mistral/latest/install/installation_guide.html
https://docs.openstack.org/mistral/latest/configuration/index.html