知识共享许可协议
本作品采用知识共享署名-非商业性使用-禁止演绎 3.0 未本地化版本许可协议进行许可。

OpenStack Install Ceilometer On Ubuntu

Author
nate.yu <nate_yhz@outlook.com>
说明
安装流程参考了网上信息,个人记录,请勿使用,发生一切事情,后果自负!!!
系统说明
  • Ubuntu 12.04.4 LTS
  • Linux controller-node 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
安装环境设置
  • 增加Havana的源

    apt-get install python-software-properties
    add-apt-repository cloud-archive:havana
    
  • 修改默认的源

    sed -i 's/cn.archive.ubuntu.com/mirrors.yun-idc.com/g' /etc/apt/sources.list
    
  • 更新源

    apt-get update
    
  • 设置控制节点IP

    export controller=192.168.100.100
    
控制节点安装
  • 在控制节点上安装 Ceilometer 组件

    apt-get install ceilometer-api ceilometer-collector ceilometer-agent-central python-ceilometerclient
    
  • 安装 Mongodb

    apt-get install mongodb-server
    
  • 修改 /etc/mongodb.conf

    vim /etc/mongodb.conf
    bind_ip = 0.0.0.0       
    
  • 停止 Mongodb

    service mongodb stop
    
  • 删除文件

    rm /var/lib/mongodb/journal/prealloc.*
    
  • 启动 Mongodb

    service mongodb start
    
  • 重启 Mongodb

    service mongodb restart
    
  • 创建数据库和用户

    mongo --host $controller --eval '
    db = db.getSiblingDB("ceilometer");
    db.addUser({user: "ceilometer",
        pwd: "nate456",
        roles: [ "readWrite", "dbAdmin" ]})'
    
  • 修改 ceilometer 配置文件

    openssl rand -hex 10
    bf5dccb63745927bfc3e
    
    vim /etc/ceilometer/ceilometer.conf
    [DEFAULT]
    auth_strategy = keystone
    
    rabbit_host = controller
    rabbit_password = RABBIT_PASS
    
    log_dir = /var/log/ceilometer
    
    [database]
    connection = mongodb://ceilometer:nate456@127.0.0.1:27017/ceilometer
    
    [publisher_rpc]
    metering_secret = bf5dccb63745927bfc3e      
    [keystone_authtoken]
    auth_host = 127.0.0.1
    auth_port = 35357
    auth_protocol = http
    auth_uri = http://127.0.0.1:5000
    admin_tenant_name = service
    admin_user = ceilometer
    admin_password = nate789
    
    [service_credentials]
    os_auth_url = http://127.0.0.1:5000/v2.0
    os_username = ceilometer
    os_tenant_name = service
    os_password = nate789
    
  • 创建 keystone 用户

    keystone user-create --name=ceilometer --pass=nate789 --email=nate_yhz@outlook.com
    
  • 绑定用户

    keystone user-role-add --user=ceilometer --tenant=service --role=admin
    
  • 创建服务

    keystone service-create --name=ceilometer --type=metering --description="Telemetry"
    
  • 创建 endpoint

    keystone endpoint-create \
    --service-id=$(keystone service-list | awk '/ metering / {print $2}') \
    --region RegionOne \
    --publicurl=http://$controller:8777 \
    --internalurl=http://$controller:8777 \
    --adminurl=http://$controller:8777
    
  • 重启

    service ceilometer-agent-central restart
    service ceilometer-api restart
    service ceilometer-collector restart
    
计算节点安装
  • 安装

    apt-get install ceilometer-agent-compute
    
  • 修改 nova.conf

    vim /etc/nova/nova.conf
    instance_usage_audit = True
    instance_usage_audit_period = hour
    notify_on_state_change = vm_and_task_state
    notification_driver = nova.openstack.common.notifier.rpc_notifier
    notification_driver = ceilometer.compute.nova_notifier
    
  • 重启计算服务

    service nova-compute restart
    
  • 修改 /etc/ceilometer/ceilometer.conf

    vim /etc/ceilometer/ceilometer.conf
    
    [DEFAULT]
    rabbit_host = 192.168.100.100
    rabbit_password = nate123
    
    log_dir = /var/log/ceilometer
    
    [publisher_rpc]
    metering_secret = bf5dccb63745927bfc3e
    
    [keystone_authtoken]
    auth_host = 192.168.100.100
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = ceilometer
    admin_password = nate789
    
    [service_credentials]
    os_auth_url = http://192.168.100.100:5000/v2.0
    os_username = ceilometer
    os_tenant_name = service
    os_password = nate789
    
  • 重启 ceilometer-agent

    service ceilometer-agent-compute restart
    
配置 Glance
  • 修改 /etc/glance/glance-api.conf

    vim /etc/glance/glance-api.conf
    notification_driver = messaging
    rpc_backend = rabbit
    notifier_strategy = rabbit
    rabbit_host = 127.0.0.1
    rabbit_password = nate123
    
  • 重启

    service glance-registry restart
    service glance-api restart
    
配置 Cinder
  • 修改 /etc/cinder/cinder.conf

    vim /etc/cinder/cinder.conf
    control_exchange = cinder
    notification_driver = cinder.openstack.common.notifier.rpc_notifier
    
  • 重启服务

    service cinder-api restart
    service cinder-scheduler restart
    service cinder-volume restart
    
相关命令
  • 查看

    ceilometer meter-list