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
This commit is contained in:
Tom Fifield 2013-10-14 21:03:43 +11:00 committed by annegentle
parent e3ad1b1a4e
commit 0ee4a3bc74
6 changed files with 353 additions and 0 deletions

View File

@ -7,4 +7,9 @@
<para>FIXME</para>
<xi:include href="../common/section_getstart_metering.xml" />
<xi:include href="section_ceilometer-install.xml" />
<xi:include href="section_ceilometer-nova.xml" />
<xi:include href="section_ceilometer-glance.xml" />
<xi:include href="section_ceilometer-cinder.xml" />
<xi:include href="section_ceilometer-swift.xml" />
</chapter>

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<section xml:id="cinder-install-cinder"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>Adding the Agent: Block Storage</title>
<procedure>
<step>
<para>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 <filename>cinder.conf</filename> file and changing
<literal>notification_driver</literal> to
<literal>cinder.openstack.common.notifier.rabbit_notifier</literal>
and <literal>control_exchange</literal> to
<literal>cinder</literal>, before restarting the service.</para>
</step>
<step os="ubuntu;debian">
<para>We now restart the Block Storage service with its new
settings.</para>
<screen><prompt>#</prompt> <userinput>service cinder-volume restart</userinput>
<prompt>#</prompt> <userinput>service cinder-api restart</userinput></screen>
</step>
<step os="rhel;fedora;centos;opensuse"><para>We now restart the Block Storage service with its new
settings.</para>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>service openstack-cinder-api start</userinput>
<prompt>#</prompt> <userinput>service openstack-cinder-agent-central start</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl start openstack-cinder-api.service</userinput>
<prompt>#</prompt> <userinput>systemctl start openstack-cinder-volume.service</userinput></screen>
</step>
</procedure>
</section>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<section xml:id="ceilometer-install-glance"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>Adding the Agent: Image Service</title>
<procedure>
<step>
<para>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 <filename>glance-api.conf</filename> file
changing <literal>notifier_strategy</literal> to
<literal>rabbit</literal> or <literal>qpid</literal> and
restarting the <systemitem class="service">glance-api</systemitem> and
<systemitem class="service">glance-registry</systemitem> services.</para>
</step>
<step os="ubuntu;debian">
<para>We now restart the Image service with its new
settings.</para>
<screen><prompt>#</prompt> <userinput>service glance-registry restart</userinput>
<prompt>#</prompt> <userinput>service glance-api restart</userinput></screen>
</step>
<step os="rhel;fedora;centos;opensuse"><para>Start the <systemitem
class="service">glance-api</systemitem> and <systemitem
class="service">glance-registry</systemitem> services and
configure them to start when the system boots.</para>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>service openstack-glance-api start</userinput>
<prompt>#</prompt> <userinput>service openstack-glance-registry start</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-glance-api on</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-glance-registry on</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl start openstack-glance-api.service</userinput>
<prompt>#</prompt> <userinput>systemctl start openstack-glance-registry.service</userinput>
<prompt>#</prompt> <userinput>systemctl enable openstack-glance-api.service</userinput>
<prompt>#</prompt> <userinput>systemctl enable openstack-glance-registry.service</userinput></screen></step>
</procedure>
</section>

View File

@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<section xml:id="ceilometer-install"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>Installing the Metering Service</title>
<procedure>
<title>Installing the central Metering Service components</title>
<para>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.</para>
<step>
<para>Install the Metering Service on the controller node:</para>
<screen os="ubuntu;deb"><prompt>#</prompt> <userinput>apt-get install ceilometer-api ceilometer-collector ceilometer-agent-central python-ceilometerclient</userinput></screen>
<screen os="rhel;centos;fedora"><prompt>#</prompt> <userinput>yum install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-agent-central python-ceilometerclient FIXME</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>zypper install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-agent-central python-ceilometerclient</userinput></screen>
</step>
<step>
<para>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.</para>
<screen os="rhel;centos;fedora"><prompt>#</prompt> <userinput>FIXME</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>zypper install mongodb</userinput></screen>
<screen os="ubuntu;debian">
<prompt>#</prompt> <userinput>apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10</userinput></screen>
<para os="ubuntu;debian">Create a new repository source <filename>/etc/apt/sources.list.d/10gen.list</filename>:</para>
<programlisting os="ubuntu;debian" language="ini">
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
</programlisting>
<para os="ubuntu;debian">Update the sources, and install the package:</para>
<screen os="ubuntu;debian">
<prompt>#</prompt> <userinput>apt-get update</userinput>
<prompt>#</prompt> <userinput>apt-get install mongodb-10gen</userinput></screen>
<para>Now, we create the database and a <literal>ceilometer</literal> user for it:</para>
<screen><prompt>#</prompt> <userinput>mongo</userinput>
<prompt>></prompt> <userinput>use ceilometer</userinput>
<prompt>></prompt> <userinput>db.addUser( { user: "ceilometer",
pwd: "<replaceable>CEILOMETER_DBPASS</replaceable>",
roles: [ "readWrite", "dbAdmin" ]
} )
</userinput></screen>
</step>
<step><para>Tell the Metering Service to use the created database.</para>
<screen os="rhel;centos;fedora;opensuse"><prompt>#</prompt> <userinput>openstack-config --set /etc/ceilometer/ceilometer.conf \
database connection mongodb://ceilometer:<replaceable>CEILOMETER_DBPASS</replaceable>@<replaceable>controller</replaceable>:27017/ceilometer</userinput></screen>
<para os="ubuntu;debian">Edit <filename>/etc/ceilometer/ceilometer.conf</filename>
and change the <literal>[database]</literal> section.</para>
<programlisting os="ubuntu;debian" language="ini">
...
[database]
...
# The SQLAlchemy connection string used to connect to the
# database (string value)
connection = mongodb://ceilometer:<replaceable>CEILOMETER_DBPASS</replaceable>@<replaceable>controller</replaceable>:27017/ceilometer
...
</programlisting>
</step>
<step>
<para>You need to define an secret key that is used as a
shared secret between the Metering Service nodes.
Use <command>openssl</command> to generate a random token, then store it
in the configuration file.</para>
<screen os="rhel;centos;fedora;opensuse"><prompt>#</prompt> <userinput>ADMIN_TOKEN=$(openssl rand -hex 10)</userinput>
<prompt>#</prompt> <userinput>echo $ADMIN_TOKEN</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/keystone/keystone.conf publisher_rpc metering_secret $ADMIN_TOKEN</userinput></screen>
<screen os="ubuntu"><prompt>#</prompt> <userinput>openssl rand -hex 10</userinput></screen>
<para os="ubuntu">Edit <filename>/etc/ceilometer/ceilometer.conf</filename> and
change the <literal>[DEFAULT]</literal> section, replacing ADMIN_TOKEN with the results of the command.</para>
<programlisting os="ubuntu" language="ini">
...
[publisher_rpc]
...
# Secret value for signing metering messages (string value)
metering_secret = ADMIN_TOKEN
...
</programlisting>
</step>
<step><para>Create a user called <literal>ceilometer</literal> so that the Metering
Service can use to authenticate with the Identity Service. Use the
<literal>service</literal> tenant and give the user the
<literal>admin</literal> role.</para>
<screen><prompt>#</prompt> <userinput>keystone user-create --name=ceilometer --pass=<replaceable>CEILOMETER_DBPASS</replaceable> --email=<replaceable>ceilometer@example.com</replaceable></userinput>
<prompt>#</prompt> <userinput>keystone user-role-add --user=ceilometer --tenant=service --role=admin</userinput></screen></step>
<step><para>Add the credentials to the Metering Service's configuration files.</para>
<screen os="centos;rhel;fedora;opensuse"><prompt>#</prompt> <userinput>openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken auth_host <replaceable>controller</replaceable></userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_user ceilometer</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_tenant_name service</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/ceilometer/ceilometer.conf keystone_authtoken admin_password <replaceable>CEILOMETER_DBPASS</replaceable></userinput></screen>
<para os="ubuntu;debian">Edit <filename>/etc/ceilometer/ceilometer.conf</filename>
and change the <literal>[keystone_authtoken]</literal> section.</para>
<programlisting os="ubuntu;debian" language="ini">
...
[keystone_authtoken]
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = ceilometer
admin_password = CEILOMETER_DBPASS
...
</programlisting>
</step>
<step><para>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 <command>keystone</command> command.</para>
<screen><prompt>#</prompt> <userinput>keystone service-create --name=ceilometer --type=metering \
--description="Ceilometer Metering Service"</userinput></screen></step>
<step><para>Note the service's <literal>id</literal> property returned in the previous step and use it when
creating the endpoint.</para>
<screen><prompt>#</prompt> <userinput>keystone endpoint-create \
--service-id=<replaceable>the_service_id_above</replaceable> \
--publicurl=http://<replaceable>controller</replaceable>:8777/ \
--internalurl=http://<replaceable>controller</replaceable>:8777/ \
--adminurl=http://<replaceable>controller</replaceable>:8777/</userinput></screen>
</step>
<step os="ubuntu;debian">
<para>We now restart the service with its new settings.</para>
<screen><prompt>#</prompt> <userinput>service ceilometer-agent-central restart</userinput>
<prompt>#</prompt> <userinput>service ceilometer-api restart</userinput>
<prompt>#</prompt> <userinput>service ceilometer-collector restart</userinput></screen>
</step>
<step os="rhel;fedora;centos;opensuse"><para>Start the <systemitem
class="service">ceilometer-api</systemitem> and <systemitem
class="service">ceilometer-api-cfn</systemitem> services and
configure them to start when the system boots.</para>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>service openstack-ceilometer-api start</userinput>
<prompt>#</prompt> <userinput>service openstack-ceilometer-agent-central start</userinput>
<prompt>#</prompt> <userinput>service openstack-ceilometer-collector start</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-ceilometer-api on</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-ceilometer-agent-central on</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-ceilometer-collector on</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl start openstack-ceilometer-api.service</userinput>
<prompt>#</prompt> <userinput>systemctl start openstack-ceilometer-agent-central.service</userinput>
<prompt>#</prompt> <userinput>systemctl start openstack-ceilometer-collector.service</userinput>
<prompt>#</prompt> <userinput>systemctl enable openstack-ceilometer-api.service</userinput>
<prompt>#</prompt> <userinput>systemctl enable openstack-ceilometer-agent-central.service</userinput>
<prompt>#</prompt> <userinput>systemctl enable openstack-ceilometer-collector.service</userinput></screen>
</step>
</procedure>
</section>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<section xml:id="ceilometer-install-nova"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>Adding the Agent: Compute</title>
<procedure>
<title>Installing the Compute Agent for Metering</title>
<para>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.</para>
<step>
<para>Install the Metering service on the controller node:</para>
<screen os="ubuntu;deb"><prompt>#</prompt> <userinput>apt-get install ceilometer-agent-compute</userinput></screen>
<screen os="rhel;centos;fedora"><prompt>#</prompt> <userinput>yum install openstack-ceilometer-agent-compute FIXME</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>zypper install openstack-ceilometer-agent-compute</userinput></screen>
</step>
<step><para>Set the following options in
<filename>/etc/nova/nova.conf</filename>.</para>
<screen os="fedora;rhel;centos;opensuse">
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT instance_usage_audit True</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT instance_usage_audit Hhour</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT notify_on_state_change vm_and_task_state</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT notification_driver nova.openstack.common.notifier.rpc_notifier</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT notification_driver ceilometer.compute.nova_driver</userinput></screen>
<para os="ubuntu;debian">Edit <filename>/etc/nova/nova.conf</filename> and add to the <literal>[DEFAULT]</literal> section.</para>
<programlisting os="ubuntu;debian" language="ini">...
[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
</programlisting>
</step>
<step>
<para>You need to set the secret key defined earlier that is used as a
shared secret between the Metering service nodes.</para>
<screen><prompt>#</prompt> <userinput>openstack-config --set /etc/keystone/keystone.conf publisher_rpc metering_secret $ADMIN_TOKEN</userinput></screen>
<para os="ubuntu">Edit <filename>/etc/ceilometer/ceilometer.conf</filename> and
change the <literal>[DEFAULT]</literal> section, replacing ADMIN_TOKEN with the one created earlier.</para>
<programlisting os="ubuntu" language="ini">
...
[publisher_rpc]
# Secret value for signing metering messages (string value)
metering_secret = ADMIN_TOKEN
...
</programlisting>
</step>
<step os="ubuntu;debian">
<para>Next, restart the service with its new settings.</para>
<screen><prompt>#</prompt> <userinput>service ceilometer-agent-compute restart</userinput></screen>
</step>
<step os="rhel;fedora;centos;opensuse"><para>Start the <literal>ceilometer-agent-compute</literal> service and configure
to start when the system boots.</para>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>service openstack-ceilometer-agent-compute start</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-ceilometer-agent-compute on</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl start openstack-ceilometer-api.service</userinput>
<prompt>#</prompt> <userinput>systemctl start openstack-ceilometer-agent-compute.service</userinput>
<prompt>#</prompt> <userinput>systemctl enable openstack-ceilometer-agent-compute.service</userinput></screen>
</step>
</procedure>
</section>

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<section xml:id="ceilometer-install-swift"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>Adding the Agent: Object Storage</title>
<procedure>
<step>
<para>In order to retrieve object store statistics, the Metering
Service needs access to Object Storage with
<literal>ResellerAdmin</literal> role. You should give this
role to your <literal>os_username</literal> user for tenant
<literal>os_tenant_name</literal>:
<screen><prompt>$</prompt> <userinput>keystone role-create --name=ResellerAdmin</userinput>
<computeroutput>+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| id | 462fa46c13fd4798a95a3bfbe27b5e54 |
| name | ResellerAdmin |
+----------+----------------------------------+
</computeroutput>
<prompt>$</prompt> <userinput>keystone user-role-add --tenant_id $SERVICE_TENANT \
--user_id $CEILOMETER_USER \
--role_id 462fa46c13fd4798a95a3bfbe27b5e54</userinput></screen>
</para>
</step>
<step>
<para>Youll also need to add the Metering middleware to Object
Storage to account for incoming and outgoing traffic, by
adding these lines to
<filename>/etc/swift/proxy-server.conf</filename>:
<programlisting language="ini">[filter:ceilometer]
use = egg:ceilometer#swift</programlisting>Next,
add <literal>ceilometer</literal> to the
<literal>pipeline</literal> parameter of that same file,
right before the entry <literal>proxy-server</literal>.</para>
</step>
<step os="ubuntu;debian">
<para>We now restart the service with its new settings.</para>
<screen><prompt>#</prompt> <userinput>service swift-proxy-server restart</userinput></screen>
</step>
<step os="rhel;fedora;centos;opensuse"><para>We now restart the service with its new settings.</para>
<screen os="rhel;fedora;centos"><prompt>#</prompt> <userinput>service openstack-swift-proxy-server restart</userinput></screen>
<screen os="opensuse"><prompt>#</prompt> <userinput>systemctl restart openstack-swift-proxy-server.service</userinput></screen>
</step>
</procedure>
</section>