zoukankan      html  css  js  c++  java
  • 安装gnocchi

    在控制节点上执行


    #!/bin/bash
    MYSQL_ROOT_PASSWD='m4r!adbOP'
    GNOCCHI_PASSWD='gnocchi1234!'
    CEILOMETER_PASSWD='ceilometer1234!'
    RABBIT_PASSWD='0penstackRMQ'
    AODH_PASSWD='aodh1234!'
    controllerHost='controller'
    OPENSTACK_RELEASE='queens'
    controller-gnocchi(){
    mysql -uroot -p${MYSQL_ROOT_PASSWD} << EOF
          DROP DATABASE IF EXISTS gnocchi;
          CREATE DATABASE gnocchi;
          GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' IDENTIFIED BY '${GNOCCHI_PASSWD}';
          GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' IDENTIFIED BY '${GNOCCHI_PASSWD}';
    EOF
    source ~/admin-openrc
    openstack user create --domain default --password ${GNOCCHI_PASSWD} gnocchi
    openstack role add --project service --user gnocchi admin
    openstack service create --name gnocchi --description "Metric Service" metric
    openstack endpoint create --region RegionOne metric public http://${controllerHost}:8041
    openstack endpoint create --region RegionOne metric internal http://${controllerHost}:8041
    openstack endpoint create --region RegionOne metric admin http://${controllerHost}:8041
    yum -y install openstack-gnocchi-api openstack-gnocchi-metricd python2-gnocchiclient
    cp /etc/gnocchi/gnocchi.conf /etc/gnocchi/gnocchi.conf_bak
    openstack-config --set /etc/gnocchi/gnocchi.conf DEFAULT log_dir /var/log/gnocchi
    openstack-config --set /etc/gnocchi/gnocchi.conf api auth_mode keystone
    openstack-config --set /etc/gnocchi/gnocchi.conf database backend sqlalchemy
    openstack-config --set /etc/gnocchi/gnocchi.conf indexer url mysql+pymysql://gnocchi:${GNOCCHI_PASSWD}@${controllerHost}/gnocchi
    openstack-config --set /etc/gnocchi/gnocchi.conf storage driver file
    openstack-config --set /etc/gnocchi/gnocchi.conf storage file_basepath /var/lib/gnocchi
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken auth_uri http://${controllerHost}:5000
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken auth_url http://${controllerHost}:35357
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken memcached_servers ${controllerHost}:11211
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken auth_version 3
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken interface internalURL
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken region_name RegionOne
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken project_domain_name default
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken user_domain_name default
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken project_name service
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken auth_type password
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken username gnocchi
    openstack-config --set /etc/gnocchi/gnocchi.conf keystone_authtoken password ${GNOCCHI_PASSWD}
    gnocchi-upgrade
    cat <<EOF> /etc/httpd/conf.d/10-gnocchi_wsgi.conf
    Listen 8041
    <VirtualHost *:8041>
        ServerName controller
        DocumentRoot "/var/www/cgi-bin/gnocchi"
        <Directory "/var/www/cgi-bin/gnocchi">
          Options Indexes FollowSymLinks MultiViews
          AllowOverride None
          Require all granted
        </Directory>
        ErrorLog "/var/log/httpd/gnocchi_wsgi_error.log"
        ServerSignature Off
        CustomLog "/var/log/httpd/gnocchi_wsgi_access.log" combined
        SetEnvIf X-Forwarded-Proto https HTTPS=1
        WSGIApplicationGroup %{GLOBAL}
        WSGIDaemonProcess gnocchi display-name=gnocchi_wsgi group=gnocchi processes=8 threads=8 user=gnocchi
        WSGIProcessGroup gnocchi
        WSGIScriptAlias / "/var/www/cgi-bin/gnocchi/app"
    </VirtualHost>
    EOF
    mkdir /var/www/cgi-bin/gnocchi/
    separateversion='queens'
    echo $OPENSTACK_RELEASE $separateversion | awk '$OPENSTACK_RELEASE >= $separateversion {/usr/bin/cp -a /usr/lib/python2.7/site-packages/gnocchi/rest/wsgi.py /var/www/cgi-bin/gnocchi/app}'
    echo $OPENSTACK_RELEASE $separateversion | awk '$OPENSTACK_RELEASE <  $separateversion {/usr/bin/cp -a /usr/lib/python2.7/site-packages/gnocchi/rest/app.wsgi /var/www/cgi-bin/gnocchi/app}'chown -R gnocchi.gnocchi /var/www/cgi-bin/gnocchi
    systemctl restart httpd
    systemctl enable openstack-gnocchi-metricd
    systemctl restart openstack-gnocchi-metricd && systemctl status openstack-gnocchi-metricd
    }

  • 相关阅读:
    Vue 面试题汇总
    SSIS 通过OData源连接Dynamic 365 Online
    SQL Server AlwaysOn
    SQL Server AlwaysOn
    SQL Server AlwaysOn
    SQL Server AlwaysOn
    OGG同步ORACLE至SQLSERVER(转)
    Power BI Online管理数据源
    SSRS 动态设置分组依据及行组个数
    查看Reporting Services服务器中用户查询报表历史记录
  • 原文地址:https://www.cnblogs.com/jipinglong/p/11223119.html
Copyright © 2011-2022 走看看