博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
StackStorm安装与配置
阅读量:6244 次
发布时间:2019-06-22

本文共 4594 字,大约阅读时间需要 15 分钟。

hot3.png

##环境 系统: ubuntu14.04/ubuntu15.04

stackstorm版本: v0.12

##依赖 ###apt

aptlist='rabbitmq-server make python-virtualenv python-dev realpath python-pip mongodb mongodb-server gcc git mysql-server python-yaml python-dateutil python-jsonpath-rw'apt-get install -y ${aptlist}

###pip 从github的requirements.txt拷贝过来,文档中的不全

mkdir /usr/local/src/st2cd /usr/local/src/st2cat << EOF > requirements.txtapscheduler>=3.0.0rc1eventlet>=0.13.0flaskflask-jsonschemagitpython==0.3.2.1jinja2jsonschema>=2.3.0kombumongoengine>=0.8.7,<0.9oslo.config>=1.12.1,<1.13paramikopecan==0.7.0pymongo<3.0python-dateutilpython-json-loggerpyyamlrequestssetuptools==11.1six==1.9.0toozgit+https://github.com/StackStorm/python-mistralclient.git@st2-0.9.0git+https://github.com/StackStorm/fabric.git@stanley-patchedpasslib>=1.6.2,<1.7lockfile>=0.10.2,<0.11python-gnupg>=0.3.7,<0.4jsonpath-rw>=1.3.0# Requirements for linux pack# used by file watcher sensorpyinotify>=0.9.5,<=0.10-e git+https://github.com/Kami/logshipper.git@stackstorm_patched#egg=logshipper# used by nmap actionspython-nmap>=0.3.4,<0.4semver>=2.1.2EOFpip install -r requirements.txt

##配置rabbitmq

rabbitmq-plugins enable rabbitmq_managementservice rabbitmq-server restart#下载管理脚本curl -sS -o /usr/bin/rabbitmqadmin http://localhost:15672/cli/rabbitmqadminchmod 755 /usr/bin/rabbitmqadmin

###Mistral 注意要关闭mistral的认证

参考

安装完成后,要注册mistral到系统服务(ubuntu14.04使用upstart,15.04使用systemd)

upstart:

cat <
/etc/init/mistral.confdescription "Mistral Workflow Service"start on runlevel [2345]stop on runlevel [016]respawnexec /opt/openstack/mistral/.venv/bin/python /opt/openstack/mistral/mistral/cmd/launch.py --config-file /etc/mistral/mistral.conf --log-config-append /etc/mistral/wf_trace_logging.confmistral_upstart

##下载并安装st2包

cd /usr/local/src/st2wget https://downloads.stackstorm.net/releases/st2/0.12.0/debs/current/st2actions_0.12.0-3_amd64.debwget https://downloads.stackstorm.net/releases/st2/0.12.0/debs/current/st2api_0.12.0-3_amd64.debwget https://downloads.stackstorm.net/releases/st2/0.12.0/debs/current/st2auth_0.12.0-3_amd64.debwget https://downloads.stackstorm.net/releases/st2/0.12.0/debs/current/st2client_0.12.0-3_amd64.debwget https://downloads.stackstorm.net/releases/st2/0.12.0/debs/current/st2common_0.12.0-3_amd64.debwget https://downloads.stackstorm.net/releases/st2/0.12.0/debs/current/st2debug_0.12.0-3_amd64.debwget https://downloads.stackstorm.net/releases/st2/0.12.0/debs/current/st2reactor_0.12.0-3_amd64.debdpkg -i *.deb

##安装WebUI ###已编译

cd /usr/local/src/st2wget https://downloads.stackstorm.net/releases/st2/0.12.0/webui/webui-0.12.0.tar.gztar -xf webui-0.12.0.tar.gzmkdir /opt/stackstorm/static/mv webui /opt/stackstorm/static/

###正式版

cd /usr/local/srcgit clone https://github.com/StackStorm/st2web.gitnode -vv0.10.32npm -v1.4.9cd /usr/local/src/st2webnpm installbower installgulp #测试web服务是否正常

编辑gulpfile.js,修改port: 8000

编译web

gulp buildgulp productionmkdir -p /opt/stackstorm/static/webuicp -rf build/* /opt/stackstorm/static/webui/

##配置WEBUI ###修改配置文件,配置正确的api接口:

#vim /opt/stackstorm/static/webui/config.js'use strict';angular.module('main')  .constant('st2Config', {    hosts: [{      name: 'Dev Env',      url: 'http://127.0.0.1:9101',      auth: false,    },]  });

###允许web访问st2api

#vim /etc/st2/st2.confallow_origin = http://st2web.example.com:3000

##配置st2 ###SUDO 默认情况下, 所有的action以stanley用户执行,可以在st2.conf修改默认配置.

1.新增用户:

useradd stanley

2.stanley需要sudo权限。

echo "stanley ALL=(ALL) NOPASSWD: SETENV: ALL" >> /etc/sudoers.d/st2 ###SSH(可选) 参考: ###禁用auth

#vim /etc/st2/st2.conf...[auth]enable = False...

###新增CLI配置(可选)

# Configuration file for the StackStorm CLI[general]base_url = http://localhostapi_version = v1# Path to the CA cert bundle used to validate the SSL certificatescacert =[cli]debug = True# True to cache the retrieved auth token during authentication in ~/.st2/token# and use the cached token in the sunsequent API requestscache_token = True[credentials]# Credentials used to authenticate against the auth API and retrieve the auth# tokenusername = test1password = testpassword[api]url = http://localhost:9101/v1[auth]url = http://localhost:9100/

##注册sensors、action、rules、aliases、policy types、policies ###注册核心模块

st2ctl reload --register-all

###注册样例 拷贝github.com/StackStorm/st2/contrib中的exampleshello-st2/opt/stackstorm/packs/目录下,然后注册:

st2 run packs.load register=all

更多第三方packs在https://github.com/StackStorm/st2contrib

##重启服务

st2ctl restart

##排错

  • 如果st2ctl restart起不来则在前台启动服务查看错误,例如:

    st2api --config-file /etc/st2/st2.conf

  • 如果有服务起不来,可能是依赖有问题,尝试再次pip install -r requests.txt

转载于:https://my.oschina.net/fmnisme/blog/592767

你可能感兴趣的文章
算法学习之路|二分图的最大匹配—匈牙利算法(Dfs实现)
查看>>
iOS UIView高级动画 关键帧动画
查看>>
java版spring cloud+spring boot+redis多租户社交电子商务平台 (六)分布式配置中心(Spring Cloud Config)...
查看>>
一个初学者是如何制作移动端B站画友社区的
查看>>
互联网分布式微服务云平台规划分析--平台整体规划
查看>>
Swift对象转为C指针
查看>>
Spring Cloud构建微服务架构:服务容错保护(Hystrix服务降级)
查看>>
ThinkSNS系统升级,版本多样化
查看>>
ecshop使用smtp发送邮件
查看>>
RubyInstaller
查看>>
21. SQL -- TSQL架构,系统数据库,文件,SQL 认证,TSQL语句
查看>>
CentOS6.0添加163和epel源
查看>>
使用组策略与脚本发布Office 2010
查看>>
Open××× 分配固定IP
查看>>
elk+redis centos6.6安装与配置
查看>>
linux下svn命令大全
查看>>
windows server 2008 在vm上安装
查看>>
我的友情链接
查看>>
谷果等手机刷机build.prop解析
查看>>
Vbox虚拟机下 Linux网络配置
查看>>