1. 为StackTach创建database,默认使用MySql,也可以 在settings.py 文件中配置其他的.

    create stack db
    mysql -u root -p
    mysql> create database stacktach;
    mysql> grant all privileges on stacktach.* to 'root'@'localhost' indentified by '';
    exit
  2. 安装django和 ./etc/pip-requires.txt
    由于pip-requires.txt中要求django >=1.5.1 < 1.6.0 ,否则在版本1.8.1出错:
    nuc:/opt/stack/stacktach$ python worker/start_workers.py
    Traceback (most recent call last):
    File "worker/start_workers.py", line , in <module>
    from django.db import close_connection
    ImportError: cannot import name close_connection

    所以在virtualenv中安装:

    stacktach$ virtualenv env1
    stacktach$ cd env1/
    stacktach$ source bin/activate
    $ pip install -r etc/pip-requires.txt
  3. Clone this repo
    git clone git://github/openstack/stacktach
  4. Copy and configure the config files in ./etc (see below for details)
    mv etc/sample_stacktach_config.sh etc/stacktach_config.json 
    mv etc/sample_stacktach_worker_config.json etc/stacktach_worker_config.json

    stack_config.json:

    export STACKTACH_DB_NAME="stacktach"
    export STACKTACH_DB_HOST="127.0.0.1"
    export STACKTACH_DB_USERNAME="root"
    export STACKTACH_DB_PASSWORD=""
    export STACKTACH_DB_PORT=""
    export STACKTACH_INSTALL_DIR="./"
    export STACKTACH_DEPLOYMENTS_FILE="etc/stacktach_worker_config.json"
    export STACKTACH_VERIFIER_CONFIG="etc/stacktach_verifier_config.json" export DJANGO_SETTINGS_MODULE="settings"

    如果你的local OpenStack环境为:

  5. [[local|localrc]]
    
    SERVICE_HOST=localhost
    DATABASE_PASSWORD=
    ADMIN_PASSWORD=
    MYSQL_PASSWORD=
    DATABASE_TYPE=mysql
    RABBIT_PASSWORD=guest
    SERVICE_PASSWORD=
    SERVICE_TOKEN=ADMIN

    stacktach_worker_config.json可以配置为:

    {"deployments": [
    {
    "name": "east_coast.prod.global",
    "durable_queue": false,
    "rabbit_host": "127.0.0.1",
    "rabbit_port": ,
    "rabbit_userid": "guest",
    "rabbit_password": "guest",
    "rabbit_virtual_host": "/",
    "exit_on_exception": true,
    "queue_name": "stacktach",
    "topics": {
    "nova": [
    {
    "queue": "notifications.info",
    "routing_key": "notifications.info"
    },
    {
    "queue": "notifications.error",
    "routing_key": "notifications.error"
    }
    ],
    "glance": [
    {
    "queue": "notifications.info",
    "routing_key": "notifications.info"
    },
    {
    "queue": "notifications.error",
    "routing_key": "notifications.error"
    }
    ]
    }
    }
    ]
    }
  6. 创建db tables 
    python manage.py syncdb
    You have installed Django's auth system, and don't have any superusers defined.
    Would you like to create one now? (yes/no): yes
    Username (leave blank to use 'yuntong'):
    Email address: ***@gmail.com
    Password:
    Password (again):
    Superuser created successfully.
  7. Configure OpenStack to publish Notifications back into RabbitMQ (see below)
  8. Restart the OpenStack services.
  9. Run the Worker to start consuming messages. (see below)
    先fix一个bug:
    diff --git a/settings.py b/settings.py
    index b6d27e5..dba5f2d
    --- a/settings.py
    +++ b/settings.py
    @@ -, +, @@ TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    - install_dir + "templates"
    + install_dir + "templates",

    运行start_workers:

  10. source etc/stacktach_config.sh
    $ python worker/start_workers.py
    Starting worker for 'east_coast.prod.global glance'
    Starting worker for 'east_coast.prod.global nova'

    打开rabbitmq的管理界面localhost:15672

  11. Run the web server (python manage.py runserver --insecure)
    python manage.py runserver --insecure
  12. Point your browser to http://127.0.0.1:8000 (the default server location)
    StackTach v2
    
    Fork me on GitHub
    Choose the Deployment to monitor All
    east_coast.prod.global
    或者访问API:
    
    curl -H "Content-Type: application/json" http://localhost:8000/stacky/deployments/ #The list of all available deployments
    [["#", "Name"], [1, "east_coast.prod.global"]]
    curl -H "Content-Type: application/json" http://localhost:8000/stacky/events/ #The distinct list of all event names
    [["Event Name"],
    ["compute.instance.create.end"], ["compute.instance.create.start"], ["compute.instance.exists"], ["compute.instance.update"],
    ["port.create.end"], ["port.create.start"], ["port.update.end"], ["port.update.start"], ["scheduler.select_destinations.end"], ["scheduler.select_destinations.start"],
    ["image.update"], ["scheduler.select_destinations.start"]]
    $ curl -H "Content-Type: application/json" http://localhost:8000/stacky/5b329e1f-c7d1-4fbe-bf15-80fcfbb22024/ #Retrieve all notifications for instances with a given UUID.
  13. Click on stuff, see what happens. You can’t hurt anything, it’s all read-only.

参考:

http://stacktach.com/api.html

http://stacktach.com/install.html

http://stacktach.readthedocs.io/en/latest/setup.html

Installing StackTach的更多相关文章

  1. installing mysql,this may take a few minutes,hold on plz wdcp卡住解决办法

    centos6安装wdcp时make in progress卡住的解决办法 今天在一台centos6的vps上安装wdcp出现的这个问题,到安装程序滚动至下面这里时出现"卡死". ...

  2. MSI Error 1603 installing AppFabric 1.1 / Win7 x64

    MSI Error 1603 installing AppFabric 1.1 / Win7 x64  Archived Forums A-B > AppFabric Caching   先说解 ...

  3. [转]Installing python 2.7 on centos 6.3. Follow this sequence exactly for centos machine only

    Okay for centos 6.4 also On apu.0xdata.loc, after this install was done $ which python /usr/local/bi ...

  4. [转]Installing SharePoint 2013 on Windows Server 2012 R2

    转自:http://www.avivroth.com/2013/07/09/installing-sharepoint-2013-on-windows-server-2012-r2-preview/ ...

  5. 安装mysql odbc遇到error 1918.errror installing ODBC driver mysql ODBC 5.3 ANSI Drive

    环境:Windows server2008r2 安装mysql-connector-odbc-5.3.6-win32 报错 相信错误信息:Error 1918.errror installing OD ...

  6. Using Confluent’s JDBC Connector without installing the entire platform

    转自:https://prefrontaldump.wordpress.com/2016/05/02/using-confluents-jdbc-connector-without-installin ...

  7. Cocoapods的安装报错 - Error installing pods:activesupport requires Ruby version >=2.2.2

    1.打开终端 2 移除现有 Ruby 默认源 输入以下指令 $gem sources --remove https://rubygems.org/ 3.使用新的源 输入以下指令 $gem source ...

  8. Installing Hadoop on Mac OSX Yosemite Tutorial Part 1.

    Installing Hadoop on Mac OSX Yosemite Tutorial Part 1. September 23, 2014 Marek 68 Comments Install ...

  9. pod install出现[!] /bin/bash -c错误,Installing Realm报错

    pod install出现错误,具体错误信息如下: Installing Realm () [!] /bin/bash -c set -e sh build.sh cocoapods-setup co ...

随机推荐

  1. _utf8_encode _utf8_decode base64_encode base64_decode

    const Base64 = { // private property _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv ...

  2. PHP定界符{}的作用

    说明: PHP解析一个字符串为"Hello,$World"时会自动解析$World. {}是方便让PHP更快的查找,它告诉PHP这里面就是变量,不用再判断是否是变量了. 例子: $ ...

  3. MySQL第二天

    回顾 数据库基础知识: 关系型数据库(磁盘)和非关系型数据库(内存)     关系型数据库: 建立在关系模型上的数据库 数据结构: 二维表(比较浪费空间) 操作数据的指令集合: SQL(DDL,DML ...

  4. Linux用户相关文件之组文件

    组信息文件: 1.文件地址: /etc/group -rw-r--r--. 1 root root 492 10月 6 21:56 /etc/group 2.文件内容: xiaol:x:500: 3. ...

  5. 深度学习:Keras入门(二)之卷积神经网络(CNN)(转)

    转自http://www.cnblogs.com/lc1217/p/7324935.html 1.卷积与神经元 1.1 什么是卷积? 简单来说,卷积(或内积)就是一种先把对应位置相乘然后再把结果相加的 ...

  6. 使用git工具上传项目到github步骤

    这里记录一下上传项目到github的步骤.使用的工具是Git bash. 1.登陆github,没有账户就注册一个,新建一个Repository(仓库). 2.绑定用户. 因为Git是分布式版本控制系 ...

  7. PDO:数据访问抽象层

    <?php //PDO:数据访问抽象层 //带有事务功能: //dsn:数据源 $dsn="mysql:host=localhost;dbname=aaas"; //造pdo ...

  8. windows下客户端开发hdf--环境搭建

    1.引入依赖 <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop- ...

  9. Spring_HelloWord

    环境:IntelliJ 14 : jdk1.8   Spring操作步骤 1.新建项目---Spring Batch 2.IntelliJ会自动加载jar包 3.现在就可以在src目录下写Java类文 ...

  10. springboot打war包

    修改pom为war不是jar. 移除tomcar的jar依赖: <dependency> <groupId>org.springframework.boot</group ...