Monasca installation and configuration guide

In this tutorial, i will describe how to setup monasca components in detail. Before we start, something needs to be confirmed:

  • All the components of monasca can be installed on one node, such as on openstack controller node, or you can deploy it in multi-nodes. In this tutorial, i will install monasca-api in a new VM created in my openstack cluster, which has a floating ip associated. Monasca-agent was installed on controller node. The agent node post metrics to api node through floating ip. the are in the same sub net.
  • All the user name and password in this tutorial is monasca and qydcos. change it to yours.
  • the installation will be performed on ubuntu 14.04 openstack Mitaka version, for liberty, special settings must be made and be described later.
  • All the file related in this tutorial are here, clone it before you start.

    1, install packages and tools we needed.

    apt-get install -y git
    apt-get install openjdk-7-jre-headless python-pip python-dev
    

    2, install mysql database
    if you install monasca-api in openstack controller node, you can skip installing it, use the msyql already installed for openstack services.

    apt-get install -y mysql-server
    

    create monasca database schema, download mon_mysql here, the schema file in github has a bug, and it can not create notification, i have fixed it here. remember to modify the user name and password in line 234,235 of mon_mysql.sql to yours.

    mysql -uroot -ppassword < mon_mysql.sql
    

    3, install zookeeper
    install zookeeper and restart it. i use localhost interface and only one zookeeper, so the default configuration file needs nothing to be configured.

    apt-get install -y zookeeper zookeeperd zookeeper-bin
    service zookeeper restart
    

    4, install and configure kafka

    wget http://apache.mirrors.tds.net/kafka/0.8.1.1/kafka_2.9.2-0.8.1.1.tgz
    mv kafka_2.9.2-0.8.1.1.tgz /opt
    cd /opt
    tar zxf kafka_2.9.2-0.8.1.1.tgz
    ln -s /opt/kafka_2.9.2-0.8.1.1/ /opt/kafka
    ln -s /opt/kafka/config /etc/kafka
    

    create kafka system user, kafka service will started as this user

    useradd kafka -U -r
    

    create kafka startup scripts in /etc/init/kafka.conf, copy following contents into /etc/init/kafka.conf and save it.

    description "Kafka"
    
    start on runlevel [2345]
    stop on runlevel [!2345]
    
    respawn
    
    limit nofile 32768 32768
    
    # If zookeeper is running on this box also give it time to start up properly
    pre-start script
        if [ -e /etc/init.d/zookeeper ]; then
            /etc/init.d/zookeeper restart
        fi
    end script
    
    # Rather than using setuid/setgid sudo is used because the pre-start task must run as root
    exec sudo -Hu kafka -g kafka KAFKA_HEAP_OPTS="-Xmx1G -Xms1G" JMX_PORT=9997 /opt/kafka/bin/kafka-server-start.sh /etc/kafka/server.properties
    

    configure kafka, vim /etc/kafka/server.properties, make sure the following contents is configured

     host.name=localhost
     advertised.host.name=localhost
     log.dirs=/var/kafka
    

    create kafka log dirs.

    mkdir /var/kafka
    mkdir /var/log/kafka
    chown -R kafka. /var/kafka/
    chown -R kafka. /var/log/kafka/
    

    start kafka service

    service kafka start
    

    the next step is to create kafka topics.

    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 64 --topic metrics
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 12 --topic events
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 12 --topic raw-events
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 12 --topic transformed-events
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 12 --topic stream-definitions
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 12 --topic transform-definitions
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 12 --topic alarm-state-transitions
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 12 --topic alarm-notifications
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 12 --topic stream-notifications
    /opt/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic retry-notifications
    

    5, install and configure influxdb

    curl -sL https://repos.influxdata.com/influxdb.key | apt-key add -
    echo "deb https://repos.influxdata.com/ubuntu trusty stable" > /etc/apt/sources.list.d/influxdb.list
    apt-get update
    apt-get install -y apt-transport-https
    apt-get install -y influxdb
    
    service influxdb start
    

    create influxdb database, user, password, retention policy, change password to yours.

    influx
    CREATE DATABASE mon
    CREATE USER monasca WITH PASSWORD 'qydcos'
    CREATE RETENTION POLICY persister_all ON mon DURATION 90d REPLICATION 1 DEFAULT
    exit
    

    6, install and configure storm

    wget http://apache.mirrors.tds.net/storm/apache-storm-0.9.6/apache-storm-0.9.6.tar.gz
    mkdir /opt/storm
    cp apache-storm-0.9.6.tar.gz /opt/storm/
    cd /opt/storm/
    tar xzf apache-storm-0.9.6.tar.gz
    ln -s /opt/storm/apache-storm-0.9.6 /opt/storm/current
    
    useradd storm -U -r
    mkdir /var/storm
    mkdir /var/log/storm
    chown -R storm. /var/storm/
    chown -R storm. /var/log/storm/
    

    modify storm.yaml as follow, vim current/storm/conf/storm.yaml

    ### base
    java.library.path: "/usr/local/lib:/opt/local/lib:/usr/lib"
    storm.local.dir: "/var/storm"
    
    ### zookeeper.*
    storm.zookeeper.servers:
        - "localhost"
    storm.zookeeper.port:  2181
    storm.zookeeper.retry.interval: 5000
    storm.zookeeper.retry.times: 29
    storm.zookeeper.root: "/storm"
    storm.zookeeper.session.timeout: 30000
    
    ### supervisor.* configs are for node supervisors
    supervisor.slots.ports:
        - 6701
        - 6702
        - 6703
        - 6704
    supervisor.childopts: "-Xmx1024m"
    
    ### worker.* configs are for task workers
    worker.childopts: "-Xmx1280m -XX:+UseConcMarkSweepGC -Dcom.sun.management.jmxremote"
    
    ### nimbus.* configs are for the masteri
    nimbus.host: "localhost"
    nimbus.thrift.port: 6627
    mbus.childopts: "-Xmx1024m"
    
    ### ui.* configs are for the master
    ui.host: 127.0.0.1
    ui.port: 8078
    ui.childopts: "-Xmx768m"
    
    ### drpc.* configs
    
    ### transactional.* configs
    transactional.zookeeper.servers:
        - "localhost"
    transactional.zookeeper.port: 2181
    transactional.zookeeper.root: "/storm-transactional"
    
    ### topology.* configs are for specific executing storms
    topology.acker.executors: 1
    topology.debug: false
    
    logviewer.port: 8077
    logviewer.childopts: "-Xmx128m"
    

    create storm supervisor startup scripts, vim /etc/init/storm-supervisor.conf

    # Startup script for Storm Supervisor
    
    description "Storm Supervisor daemon"
    start on runlevel [2345]
    
    console log
    respawn
    
    kill timeout 240
    respawn limit 25 5
    
    setgid storm
    setuid storm
    chdir /opt/storm/current
    exec /opt/storm/current/bin/storm supervisor
    

    create storm nimbus scripts.vim /etc/init/storm-nimbus.conf

    # Startup script for Storm Nimbus
    
    description "Storm Nimbus daemon"
    start on runlevel [2345]
    
    console log
    respawn
    
    kill timeout 240
    respawn limit 25 5
    
    setgid storm
    setuid storm
    chdir /opt/storm/current
    exec /opt/storm/current/bin/storm nimbus
    

    start storm supervisor and nimbus

    service storm-supervisor start
    service storm-nimbus start
    

    7, install monasca api python packages
    some monasca components have both python and java code available, mainly i choose python code to deploy.

    pip install monasca-common
    pip install gunicorn
    pip install greenlet  # Required for both
    pip install eventlet  # For eventlet workers
    pip install gevent    # For gevent workers
    pip install monasca-api
    pip install influxdb
    

    vim /etc/monasca/api-config.ini , modify host to your ip address

    [DEFAULT]
    name = monasca_api
    
    [pipeline:main]
    # Add validator in the pipeline so the metrics messages can be validated.
    pipeline = auth keystonecontext api
    
    [app:api]
    paste.app_factory = monasca_api.api.server:launch
    
    [filter:auth]
    paste.filter_factory = keystonemiddleware.auth_token:filter_factory
    
    [filter:keystonecontext]
    paste.filter_factory = monasca_api.middleware.keystone_context_filter:filter_factory
    
    [server:main]
    use = egg:gunicorn#main
    host = 192.168.2.23
    port = 8082
    workers = 1
    proc_name = monasca_api
    

    vim /etc/monasca/api-config.conf, modify the following contents

    [DEFAULT]
    # logging, make sure that the user under whom the server runs has permission
    # to write to the directory.
    log_file = monasca-api.log
    log_dir = /var/log/monasca/api/
    debug=False
    region = RegionOne
    [security]
    # The roles that are allowed full access to the API.
    default_authorized_roles = admin, user, domainuser, domainadmin, monasca-user
    
    # The roles that are allowed to only POST metrics to the API. This role would be used by the Monasca Agent.
    agent_authorized_roles = admin
    
    # The roles that are allowed to only GET metrics from the API.
    read_only_authorized_roles = admin
    
    # The roles that are allowed to access the API on behalf of another tenant.
    # For example, a service can POST metrics to another tenant if they are a member of the "delegate" role.
    delegate_authorized_roles = admin
    
    [kafka]
    # The endpoint to the kafka server
    uri = localhost:9092
    
    [influxdb]
    # Only needed if Influxdb database is used for backend.
    # The IP address of the InfluxDB service.
    ip_address = localhost
    
    # The port number that the InfluxDB service is listening on.
    port = 8086
    
    # The username to authenticate with.
    user = monasca
    
    # The password to authenticate with.
    password = qydcos
    
    # The name of the InfluxDB database to use.
    database_name = mon
    
    [database]
    url = "mysql+pymysql://monasca:[email protected]/mon"
    
    
    [keystone_authtoken]
    identity_uri = http://192.168.1.11:35357
    auth_uri = http://192.168.1.11:5000
    admin_password = qydcos
    admin_user = monasca
    admin_tenant_name = service
    cafile =
    certfile =
    keyfile =
    insecure = false
    

    comment out [mysql] section, others keeps on default.
    create monasca system user and log dirs

    useradd monasca -U -r
    mkdir /var/log/monasca
    mkdir /var/log/monasca/api
    chown -R monasca. /var/log/monasca/
    

    on openstack controller node, create monasca user password, assign admin role for user monasca in tenant service.

    openstack user create --domain default --password qydcos monasca 
    openstack role add --project service --user monasca admin
    
    openstack service create --name monasca --description "Monasca monitoring service" monitoring
    
    create endpoint 
    openstack endpoint create --region RegionOne monasca public http://192.168.1.143:8082/v2.0
    openstack endpoint create --region RegionOne monasca internal http://192.168.1.143:8082/v2.0
    openstack endpoint create --region RegionOne monasca admin http://192.168.1.143:8082/v2.0
    

    192.168.1.143 is the floating ip of my api vm address, change it to yours.
    create monasca api startup scripts,vim /etc/init/monasca-api.conf

    # Startup script for the Monasca API
    
    description "Monasca API Python app"
    start on runlevel [2345]
    
    console log
    respawn
    
    setgid monasca
    setuid monasca
    exec /usr/local/bin/gunicorn -n monasca-api -k eventlet --worker-connections=2000 --backlog=1000 --paste /etc/monasca/api-config.ini
    

    start monasca-api service

    service monasca-api start
    

    if you get mysql connection error, modify monasca-common python file, and restart monasca-api service, the python code has bug reading mysql configuration. here is a quick hack,
    vim /usr/local/lib/python2.7/dist-packages/monasca_common/repositories/mysql/mysql_repository.py

                self.conf = cfg.CONF
                #self.database_name = self.conf.mysql.database_name
                #self.database_server = self.conf.mysql.hostname
                #self.database_uid = self.conf.mysql.username
                #self.database_pwd = self.conf.mysql.password
    
                self.database_name = 'mon'
                self.database_server = 'localhost'
                self.database_uid = 'monasca'
                self.database_pwd = 'qydcos'
    
    

    8, install monasca-persister
    the monasca-persister java code has a bug writting data into influxdb, i fixed it and rebuild a jar file and upload it into monasca.git. the monasca-persister python code also has a bug writting data into influxdb, i have no time to fix it.

    copy monasca-persister.jar file into /opt/monasca/
    copy persister-config.yml into /etc/monasca/

    create monasca-persister startup script
    vim /etc/init/monasca-persister.conf

    # Startup script for the Monasca Persister
    
    description "Monasca Persister Python app"
    start on runlevel [2345]
    
    console log
    respawn
    
    setgid monasca
    setuid monasca
    exec /usr/bin/java -Dfile.encoding=UTF-8 -cp /opt/monasca/monasca-persister.jar monasca.persister.PersisterApplication server /etc/monasca/persister-config.yml
    

    start monasca-persister

    service monasca-persister start
    

    9, install monasca-notificatoin

    pip install --upgrade monasca-notification
    apt-get install sendmail
    

    copy notification.yaml into /etc/monasca/
    create startup script, vim /etc/init/monasca-notification.conf

    # Startup script for the monasca_notification
    
    description "Monasca Notification daemon"
    start on runlevel [2345]
    
    console log
    respawn
    
    setgid monasca
    setuid monasca
    exec /usr/bin/python /usr/local/bin/monasca-notification
    

    start notification service

    service monasca-notification start
    

    10, install monasca-thresh
    copy monasca-thresh into /etc/init.d/
    copy monasca-thresh.jar into /opt/monasca-thresh/
    copy thresh-config.yml into /etc/monasca/ and modify host, database to yours.
    start monasca-thresh

    service monasca-thresh start
    

    11, install monasca-agent
    install monasca-agent on openstack controller node, so that it can monitor openstack service process.

    sudo pip install --upgrade monasca-agent
    

    setup monasca-agent, if you are on liberty, change user domain id and project domain id to default, for mitaka, use default domain id,

    monasca-setup -u monasca -p qydcos --user_domain_id e25e0413a70c41449d2ccc2578deb1e4 --project_domain_id e25e0413a70c41449d2ccc2578deb1e4 --user monasca \
     --project_name service -s monitoring --keystone_url http://192.168.1.11:35357/v3 --monasca_url http://192.168.1.143:8082/v2.0 --config_dir /etc/monasca/agent --log_dir /var/log/monasca/agent --overwrite
    

    source admin-rc.sh, run monasca metric-list

  • 128 comments

    1. I get error when a run command:
      /usr/local/bin/gunicorn -n monasca-api -k eventlet –worker-connections=2000 –backlog=1000 –paste /etc/monasca/api-config.ini

      Error:
      File “/usr/local/lib/python2.7/dist-packages/monasca_common/simport/simport.py”, line 63, in _get_module
      filepath, sep, namespace = target.rpartition(‘|’)
      AttributeError: ‘NoneType’ object has no attribute ‘rpartition’

      Any solution to fix?

      1. this may be caused by a invalid module name, or in correct python module version, this is mine:
        [email protected]:~# ls /usr/local/lib/python2.7/dist-packages/monasca_common
        monasca_common/ monasca_common-1.1.0.dist-info/
        [email protected]:~# ls /usr/local/lib/python2.7/dist-packages/monasca_common

        i need more information about error logs, paste it up or mail me.

    2. This is mine:
      [email protected]:/home/ubuntu# ls /usr/local/lib/python2.7/dist-packages/monasca_common
      monasca_common/ monasca_common-1.2.0.dist-info/

      And error:

      [email protected]:/home/ubuntu# /usr/local/bin/gunicorn -n monasca-api -k eventlet –worker-connections=2000 –backlog=1000 –paste /etc/monasca/api-config.ini
      [2016-12-19 02:39:12 +0000] [21574] [INFO] Starting gunicorn 19.6.0
      [2016-12-19 02:39:12 +0000] [21574] [INFO] Listening at: http://10.6.0.29:8082 (21574)
      [2016-12-19 02:39:12 +0000] [21574] [INFO] Using worker: eventlet
      [2016-12-19 02:39:12 +0000] [21579] [INFO] Booting worker with pid: 21579
      [2016-12-19 02:39:15 +0000] [21579] [ERROR] Exception in worker process
      Traceback (most recent call last):
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py”, line 557, in spawn_worker
      worker.init_process()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/workers/geventlet.py”, line 96, in init_process
      super(EventletWorker, self).init_process()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py”, line 126, in init_process
      self.load_wsgi()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py”, line 136, in load_wsgi
      self.wsgi = self.app.wsgi()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py”, line 67, in wsgi
      self.callable = self.load()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py”, line 63, in load
      return self.load_pasteapp()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py”, line 59, in load_pasteapp
      return load_pasteapp(self.cfgurl, self.relpath, global_conf=None)
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/app/pasterapp.py”, line 69, in load_pasteapp
      global_conf=global_conf)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 247, in loadapp
      return loadobj(APP, uri, name=name, **kw)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 272, in loadobj
      return context.create()
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 710, in create
      return self.object_type.invoke(self)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 203, in invoke
      app = context.app_context.create()
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 710, in create
      return self.object_type.invoke(self)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 146, in invoke
      return fix_call(context.object, context.global_conf, **context.local_conf)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/util.py”, line 55, in fix_call
      val = callable(*args, **kw)
      File “/usr/local/lib/python2.7/dist-packages/monasca_api/api/server.py”, line 120, in launch
      dimension_names = simport.load(cfg.CONF.dispatcher.dimension_names)()
      File “/usr/local/lib/python2.7/dist-packages/monasca_common/simport/simport.py”, line 100, in load
      module, klass, function = _get_module(target)
      File “/usr/local/lib/python2.7/dist-packages/monasca_common/simport/simport.py”, line 66, in _get_module
      filepath, sep, namespace = target.rpartition(‘|’)
      AttributeError: ‘NoneType’ object has no attribute ‘rpartition’
      [2016-12-19 02:39:15 +0000] [21579] [INFO] Worker exiting (pid: 21579)
      [2016-12-19 02:39:16 +0000] [21574] [INFO] Shutting down: Master
      [2016-12-19 02:39:16 +0000] [21574] [INFO] Reason: Worker failed to boot.

      1. 1,make sure these configurations are in /etc/monasca/api-config.conf
        # Dispatchers to be loaded to serve restful APIs
        [dispatcher]
        versions = monasca_api.v2.reference.versions:Versions
        version_2_0 = monasca_api.v2.reference.version_2_0:Version2
        metrics = monasca_api.v2.reference.metrics:Metrics
        metrics_measurements = monasca_api.v2.reference.metrics:MetricsMeasurements
        metrics_statistics = monasca_api.v2.reference.metrics:MetricsStatistics
        metrics_names = monasca_api.v2.reference.metrics:MetricsNames
        alarm_definitions = monasca_api.v2.reference.alarm_definitions:AlarmDefinitions
        alarms = monasca_api.v2.reference.alarms:Alarms
        alarms_count = monasca_api.v2.reference.alarms:AlarmsCount
        alarms_state_history = monasca_api.v2.reference.alarms:AlarmsStateHistory
        notification_methods = monasca_api.v2.reference.notifications:Notifications
        dimension_values = monasca_api.v2.reference.metrics:DimensionValues
        notification_method_types = monasca_api.v2.reference.notificationstype:NotificationsType

        2, in this file: /usr/local/lib/python2.7/dist-packages/monasca_api/v2/reference/metrics.py
        class DimensionValues(metrics_api_v2.DimensionValuesV2API): are existed.

    3. I create monasca api startup scripts,vim /etc/init/monasca-api.conf:
      # Startup script for the Monasca API

      description “Monasca API Python app”
      start on runlevel [2345]

      console log
      respawn

      setgid monasca
      setuid monasca
      exec /usr/local/bin/gunicorn -n monasca-api -k eventlet –worker-connections=2000 –backlog=1000 –paste /etc/monasca/api-config.ini

      I start monasca-api service but process always restart with new PID, so I debug by exec “/usr/local/bin/gunicorn -n monasca-api -k eventlet –worker-connections=2000 –backlog=1000 –paste /etc/monasca/api-config.ini” and i get error. Only monasca-api service get error.

      1. what’s the permissions of your /etc/monasca/api-config.conf file?
        following is mine:
        [email protected]:~# ls -al /etc/monasca/
        total 36
        drwxr-xr-x 2 root root 4096 Dec 19 10:51 .
        drwxr-xr-x 112 root root 4096 Dec 16 11:22 ..
        -rwxr-xr-x 1 root root 5133 Sep 28 13:51 api-config.conf
        -rw-r–r– 1 root root 518 Sep 27 18:42 api-config.ini
        -rw-r–r– 1 root root 2804 Sep 28 11:16 notification.yaml
        -rw-r–r– 1 root root 2346 Sep 27 19:12 persister.conf
        -rw-r–r– 1 root root 4034 Sep 28 17:39 persister-config.yml
        -rw-r–r– 1 root root 2932 Sep 27 19:31 thresh-config.yml
        [email protected]:~#

        from my point of view, it’s caused by the monasca process which has no permission to access api-config.conf file, so, it can not get dimension_values in api/server.py

        from the source code of here, dimension_values = simport.load(cfg.CONF.dispatcher.dimension_values)()
        simport.load, simport.load() get a none type as its parameter.

        to a quick workaround, you can set dimension_values in /usr/local/lib/python2.7/dist-packages/monasca_api/api/server.py ,line 47 to monasca_api.v2.reference.metrics:DimensionValues to get a try

    4. [email protected]:/home/ubuntu# vim +47 /usr/local/lib/python2.7/dist-packages/monasca_api/api/server.py
      [email protected]:/home/ubuntu# /usr/local/bin/gunicorn -n monasca-api -k eventlet –worker-connections=2000 –backlog=1000 –p
      [2016-12-19 03:45:50 +0000] [21812] [INFO] Starting gunicorn 19.6.0
      [2016-12-19 03:45:50 +0000] [21812] [INFO] Listening at: http://10.6.0.29:8082 (21812)
      [2016-12-19 03:45:50 +0000] [21812] [INFO] Using worker: eventlet
      [2016-12-19 03:45:50 +0000] [21817] [INFO] Booting worker with pid: 21817
      [2016-12-19 03:45:50 +0000] [21817] [ERROR] Exception in worker process
      Traceback (most recent call last):
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py”, line 557, in spawn_worker
      worker.init_process()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/workers/geventlet.py”, line 96, in init_process
      super(EventletWorker, self).init_process()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py”, line 126, in init_process
      self.load_wsgi()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py”, line 136, in load_wsgi
      self.wsgi = self.app.wsgi()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py”, line 67, in wsgi
      self.callable = self.load()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py”, line 63, in load
      return self.load_pasteapp()
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py”, line 59, in load_pasteapp
      return load_pasteapp(self.cfgurl, self.relpath, global_conf=None)
      File “/usr/local/lib/python2.7/dist-packages/gunicorn/app/pasterapp.py”, line 69, in load_pasteapp
      global_conf=global_conf)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 247, in loadapp
      return loadobj(APP, uri, name=name, **kw)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 272, in loadobj
      return context.create()
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 710, in create
      return self.object_type.invoke(self)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 203, in invoke
      app = context.app_context.create()
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 710, in create
      return self.object_type.invoke(self)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py”, line 146, in invoke
      return fix_call(context.object, context.global_conf, **context.local_conf)
      File “/usr/local/lib/python2.7/dist-packages/paste/deploy/util.py”, line 55, in fix_call
      val = callable(*args, **kw)
      File “/usr/local/lib/python2.7/dist-packages/monasca_api/api/server.py”, line 120, in launch
      dimension_names = simport.load(cfg.CONF.dispatcher.dimension_names)()
      File “/usr/local/lib/python2.7/dist-packages/monasca_common/simport/simport.py”, line 94, in load
      module, klass, function = _get_module(target)
      File “/usr/local/lib/python2.7/dist-packages/monasca_common/simport/simport.py”, line 63, in _get_module
      filepath, sep, namespace = target.rpartition(‘|’)
      AttributeError: ‘NoneType’ object has no attribute ‘rpartition’
      [2016-12-19 03:45:50 +0000] [21817] [INFO] Worker exiting (pid: 21817)
      [2016-12-19 03:45:50 +0000] [21812] [INFO] Shutting down: Master
      [2016-12-19 03:45:50 +0000] [21812] [INFO] Reason: Worker failed to boot.

      I fixed it follow your comment, but i still get error. Also, i “pip install –upgrade monasca_common==1.1.0 but still like this.

      1. what’s the result of changing in File “/usr/local/lib/python2.7/dist-packages/monasca_api/api/server.py”, line 120, in launch
        dimension_names = simport.load(cfg.CONF.dispatcher.dimension_names)()
        to
        dimension_names = simport.load(‘monasca_api.v2.reference.metrics:DimensionValues’)()

      1. i think it’s config file problem.
        first, check in apt-config.conf file, make sure dimension_values = monasca_api.v2.reference.metrics:DimensionValues is in [dispatcher] section.
        2,check out api-confg.conf file permission, does the monasca user have ability to read this file?
        3, check /usr/local/lib/python2.7/dist-packages/monasca_api/api/server.py line 59,
        def launch(conf, config_file=”/etc/monasca/api-config.conf”):
        the default config file path is correct.
        if all above is correct, python oslo_config module is incorrect.

    5. Maybe different version between Mitaka and Liberty, when i access to url “http://ip:8082”, i get:

      {“error”: {“message”: “The request you have made requires authentication.”, “code”: 401, “title”: “Unauthorized”}}

    Leave a Reply

    Your email address will not be published. Required fields are marked *