From 0ee4a3bc74381aa9b28451c7f275d74e9bdab609 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Mon, 14 Oct 2013 21:03:43 +1100 Subject: [PATCH] Add Ceilometer install This adds an initial install of ceilometer to the install guide. This has not been tested. Also adds stub sections for adding agents/setting up notification to things. Change-Id: Ieb154f1412f32279550b0a5a4a0cafc1547b8b61 --- doc/install-guide/ch_ceilometer.xml | 5 + .../section_ceilometer-cinder.xml | 32 ++++ .../section_ceilometer-glance.xml | 37 ++++ .../section_ceilometer-install.xml | 158 ++++++++++++++++++ doc/install-guide/section_ceilometer-nova.xml | 74 ++++++++ .../section_ceilometer-swift.xml | 47 ++++++ 6 files changed, 353 insertions(+) create mode 100644 doc/install-guide/section_ceilometer-cinder.xml create mode 100644 doc/install-guide/section_ceilometer-glance.xml create mode 100644 doc/install-guide/section_ceilometer-install.xml create mode 100644 doc/install-guide/section_ceilometer-nova.xml create mode 100644 doc/install-guide/section_ceilometer-swift.xml diff --git a/doc/install-guide/ch_ceilometer.xml b/doc/install-guide/ch_ceilometer.xml index a9d2a830e2..77837488e2 100644 --- a/doc/install-guide/ch_ceilometer.xml +++ b/doc/install-guide/ch_ceilometer.xml @@ -7,4 +7,9 @@ FIXME + + + + + diff --git a/doc/install-guide/section_ceilometer-cinder.xml b/doc/install-guide/section_ceilometer-cinder.xml new file mode 100644 index 0000000000..85d10bcde4 --- /dev/null +++ b/doc/install-guide/section_ceilometer-cinder.xml @@ -0,0 +1,32 @@ + +
+ Adding the Agent: Block Storage + + + If you want to be able to retrieve volume samples, you need to + instruct Block Storage to send notifications to the bus by + editing the cinder.conf file and changing + notification_driver to + cinder.openstack.common.notifier.rabbit_notifier + and control_exchange to + cinder, before restarting the service. + + + We now restart the Block Storage service with its new + settings. +# service cinder-volume restart +# service cinder-api restart + + We now restart the Block Storage service with its new + settings. + # service openstack-cinder-api start +# service openstack-cinder-agent-central start + # systemctl start openstack-cinder-api.service +# systemctl start openstack-cinder-volume.service + + + +
diff --git a/doc/install-guide/section_ceilometer-glance.xml b/doc/install-guide/section_ceilometer-glance.xml new file mode 100644 index 0000000000..897ac1fe91 --- /dev/null +++ b/doc/install-guide/section_ceilometer-glance.xml @@ -0,0 +1,37 @@ + +
+ Adding the Agent: Image Service + + + If you want to be able to retrieve image samples, you need + to instruct the Image Service to send notifications to the bus + by editing the glance-api.conf file + changing notifier_strategy to + rabbit or qpid and + restarting the glance-api and + glance-registry services. + + + We now restart the Image service with its new + settings. +# service glance-registry restart +# service glance-api restart + + + Start the glance-api and glance-registry services and + configure them to start when the system boots. + # service openstack-glance-api start +# service openstack-glance-registry start +# chkconfig openstack-glance-api on +# chkconfig openstack-glance-registry on + # systemctl start openstack-glance-api.service +# systemctl start openstack-glance-registry.service +# systemctl enable openstack-glance-api.service +# systemctl enable openstack-glance-registry.service + +
diff --git a/doc/install-guide/section_ceilometer-install.xml b/doc/install-guide/section_ceilometer-install.xml new file mode 100644 index 0000000000..a398d9805c --- /dev/null +++ b/doc/install-guide/section_ceilometer-install.xml @@ -0,0 +1,158 @@ + +
+ Installing the Metering Service + + Installing the central Metering Service components + The Metering service consists of an API service, collector + and a range of disparate agents. This procedure details + installing the "central" components, prior to installing agents + elsewhere, such as on the compute node. + + Install the Metering Service on the controller node: + # apt-get install ceilometer-api ceilometer-collector ceilometer-agent-central python-ceilometerclient + # yum install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-agent-central python-ceilometerclient FIXME + # zypper install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-agent-central python-ceilometerclient + + + + The Orchestration Service uses a database to store information. + Specify the location of the database in the configuration file. + In this guide, we use a MongoDB database on the controller node. + # FIXME + # zypper install mongodb + + + # apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 + Create a new repository source /etc/apt/sources.list.d/10gen.list: + + deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen + + Update the sources, and install the package: + + # apt-get update + # apt-get install mongodb-10gen + Now, we create the database and a ceilometer user for it: + # mongo +> use ceilometer +> db.addUser( { user: "ceilometer", + pwd: "CEILOMETER_DBPASS", + roles: [ "readWrite", "dbAdmin" ] + } ) + + + + + Tell the Metering Service to use the created database. + # openstack-config --set /etc/ceilometer/ceilometer.conf \ + database connection mongodb://ceilometer:CEILOMETER_DBPASS@controller:27017/ceilometer + Edit /etc/ceilometer/ceilometer.conf + and change the [database] section. + +... +[database] +... +# The SQLAlchemy connection string used to connect to the +# database (string value) +connection = mongodb://ceilometer:CEILOMETER_DBPASS@controller:27017/ceilometer +... + + + + + + You need to define an secret key that is used as a + shared secret between the Metering Service nodes. + Use openssl to generate a random token, then store it + in the configuration file. + # ADMIN_TOKEN=$(openssl rand -hex 10) +# echo $ADMIN_TOKEN +# openstack-config --set /etc/keystone/keystone.conf publisher_rpc metering_secret $ADMIN_TOKEN + # openssl rand -hex 10 +Edit /etc/ceilometer/ceilometer.conf and + change the [DEFAULT] section, replacing ADMIN_TOKEN with the results of the command. + +... +[publisher_rpc] +... +# Secret value for signing metering messages (string value) +metering_secret = ADMIN_TOKEN +... + + + + + + + Create a user called ceilometer so that the Metering + Service can use to authenticate with the Identity Service. Use the + service tenant and give the user the + admin role. + # keystone user-create --name=ceilometer --pass=CEILOMETER_DBPASS --email=ceilometer@example.com +# keystone user-role-add --user=ceilometer --tenant=service --role=admin + +Add the credentials to the Metering Service's configuration files. + + # openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken auth_host controller +# openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_user ceilometer +# openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_tenant_name service +# openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_password CEILOMETER_DBPASS + Edit /etc/ceilometer/ceilometer.conf + and change the [keystone_authtoken] section. + +... +[keystone_authtoken] +auth_host = controller +auth_port = 35357 +auth_protocol = http +admin_tenant_name = service +admin_user = ceilometer +admin_password = CEILOMETER_DBPASS +... + + + + + Register the Metering Service with the Identity Service + so that other OpenStack services can locate it. Register the service and + specify the endpoint using the keystone command. + # keystone service-create --name=ceilometer --type=metering \ + --description="Ceilometer Metering Service" + Note the service's id property returned in the previous step and use it when + creating the endpoint. + # keystone endpoint-create \ + --service-id=the_service_id_above \ + --publicurl=http://controller:8777/ \ + --internalurl=http://controller:8777/ \ + --adminurl=http://controller:8777/ + + + + We now restart the service with its new settings. +# service ceilometer-agent-central restart +# service ceilometer-api restart +# service ceilometer-collector restart + + + Start the ceilometer-api and ceilometer-api-cfn services and + configure them to start when the system boots. + # service openstack-ceilometer-api start +# service openstack-ceilometer-agent-central start +# service openstack-ceilometer-collector start +# chkconfig openstack-ceilometer-api on +# chkconfig openstack-ceilometer-agent-central on +# chkconfig openstack-ceilometer-collector on + # systemctl start openstack-ceilometer-api.service +# systemctl start openstack-ceilometer-agent-central.service +# systemctl start openstack-ceilometer-collector.service +# systemctl enable openstack-ceilometer-api.service +# systemctl enable openstack-ceilometer-agent-central.service +# systemctl enable openstack-ceilometer-collector.service + + + +
diff --git a/doc/install-guide/section_ceilometer-nova.xml b/doc/install-guide/section_ceilometer-nova.xml new file mode 100644 index 0000000000..6a4829e9b3 --- /dev/null +++ b/doc/install-guide/section_ceilometer-nova.xml @@ -0,0 +1,74 @@ + +
+ Adding the Agent: Compute + + Installing the Compute Agent for Metering + The Metering service consists of an API service, collector and a range + of disparate agents. This procedure details the installation of the agent + that runs on compute nodes. + + Install the Metering service on the controller node: + # apt-get install ceilometer-agent-compute + # yum install openstack-ceilometer-agent-compute FIXME + # zypper install openstack-ceilometer-agent-compute + + + Set the following options in + /etc/nova/nova.conf. + +# openstack-config --set /etc/nova/nova.conf DEFAULT instance_usage_audit True +# openstack-config --set /etc/nova/nova.conf DEFAULT instance_usage_audit Hhour +# openstack-config --set /etc/nova/nova.conf DEFAULT notify_on_state_change vm_and_task_state +# openstack-config --set /etc/nova/nova.conf DEFAULT notification_driver nova.openstack.common.notifier.rpc_notifier +# openstack-config --set /etc/nova/nova.conf DEFAULT notification_driver ceilometer.compute.nova_driver + Edit /etc/nova/nova.conf and add to the [DEFAULT] section. + ... +[DEFAULT] +... +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 + + + + + + You need to set the secret key defined earlier that is used as a + shared secret between the Metering service nodes. +# openstack-config --set /etc/keystone/keystone.conf publisher_rpc metering_secret $ADMIN_TOKEN +Edit /etc/ceilometer/ceilometer.conf and + change the [DEFAULT] section, replacing ADMIN_TOKEN with the one created earlier. + +... +[publisher_rpc] +# Secret value for signing metering messages (string value) +metering_secret = ADMIN_TOKEN +... + + + + + + + + Next, restart the service with its new settings. +# service ceilometer-agent-compute restart + + + + Start the ceilometer-agent-compute service and configure + to start when the system boots. + # service openstack-ceilometer-agent-compute start +# chkconfig openstack-ceilometer-agent-compute on + # systemctl start openstack-ceilometer-api.service +# systemctl start openstack-ceilometer-agent-compute.service +# systemctl enable openstack-ceilometer-agent-compute.service + + + +
diff --git a/doc/install-guide/section_ceilometer-swift.xml b/doc/install-guide/section_ceilometer-swift.xml new file mode 100644 index 0000000000..22d1994112 --- /dev/null +++ b/doc/install-guide/section_ceilometer-swift.xml @@ -0,0 +1,47 @@ + +
+ Adding the Agent: Object Storage + + + In order to retrieve object store statistics, the Metering + Service needs access to Object Storage with + ResellerAdmin role. You should give this + role to your os_username user for tenant + os_tenant_name: + $ keystone role-create --name=ResellerAdmin ++----------+----------------------------------+ +| Property | Value | ++----------+----------------------------------+ +| id | 462fa46c13fd4798a95a3bfbe27b5e54 | +| name | ResellerAdmin | ++----------+----------------------------------+ + +$ keystone user-role-add --tenant_id $SERVICE_TENANT \ + --user_id $CEILOMETER_USER \ + --role_id 462fa46c13fd4798a95a3bfbe27b5e54 + + + + You’ll also need to add the Metering middleware to Object + Storage to account for incoming and outgoing traffic, by + adding these lines to + /etc/swift/proxy-server.conf: + [filter:ceilometer] +use = egg:ceilometer#swiftNext, + add ceilometer to the + pipeline parameter of that same file, + right before the entry proxy-server. + + + We now restart the service with its new settings. +# service swift-proxy-server restart + + We now restart the service with its new settings. + # service openstack-swift-proxy-server restart + # systemctl restart openstack-swift-proxy-server.service + + +