mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-19 12:03:50 +01:00
124 lines
9.0 KiB
HTML
124 lines
9.0 KiB
HTML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>14.1. Configuring the Usage Server</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Apache_CloudStack-Admin_Guide-4.0.0-incubating-en-US-1-" /><link rel="home" href="index.html" title="CloudStack Administrator's Guide" /><link rel="up" href="work-with-usage.html" title="Chapter 14. Working with Usage" /><link rel="prev" href="work-with-usage.html" title="Chapter 14. Working with Usage" /><link rel="next" href="set-usage-limit.html" title="14.2. Setting Usage Limits" /></head><body><p id="title"><a class="left" href="http://cloudstack.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://docs.cloudstack.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="work-with-usage.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="set-usage-limit.html"><strong>Next</strong></a></li></ul><div xml:lang="en-US" class="section" id="configure-usage-server" lang="en-US"><div class="titlepage"><div><div><h2 class="title" id="configure-usage-server">14.1. Configuring the Usage Server</h2></div></div></div><div class="para">
|
||
To configure the usage server:
|
||
</div><div class="orderedlist"><ol><li class="listitem"><div class="para">
|
||
Be sure the Usage Server has been installed. This requires extra steps beyond just installing the CloudStack software. See Installing the Usage Server (Optional) in the Advanced Installation Guide.
|
||
</div></li><li class="listitem"><div class="para">
|
||
Log in to the CloudStack UI as administrator.
|
||
</div></li><li class="listitem"><div class="para">
|
||
Click Global Settings.
|
||
</div></li><li class="listitem"><div class="para">
|
||
In Search, type usage. Find the configuration parameter that controls the behavior you want to set. See the table below for a description of the available parameters.
|
||
</div></li><li class="listitem"><div class="para">
|
||
In Actions, click the Edit icon.
|
||
</div></li><li class="listitem"><div class="para">
|
||
Type the desired value and click the Save icon.
|
||
</div></li><li class="listitem"><div class="para">
|
||
Restart the Management Server (as usual with any global configuration change) and also the Usage Server:
|
||
</div><pre class="programlisting"># service cloud-management restart
|
||
# service cloud-usage restart
|
||
</pre></li></ol></div><div class="para">
|
||
The following table shows the global configuration settings that control the behavior of the Usage Server.
|
||
</div><div class="informaltable"><table border="1"><colgroup><col width="50%" /><col width="50%" /></colgroup><thead><tr><th align="left">
|
||
<div class="para">
|
||
Parameter Name
|
||
</div>
|
||
</th><th align="left">
|
||
<div class="para">
|
||
Description
|
||
</div>
|
||
</th></tr></thead><tbody><tr><td align="left">
|
||
<div class="para">
|
||
enable.usage.server
|
||
</div>
|
||
</td><td align="left">
|
||
<div class="para">
|
||
Whether the Usage Server is active.
|
||
</div>
|
||
</td></tr><tr><td align="left">
|
||
<div class="para">
|
||
usage.aggregation.timezone
|
||
</div>
|
||
</td><td align="left">
|
||
<div class="para">
|
||
Time zone of usage records. Set this if the usage records and daily job execution are in different time zones. For example, with the following settings, the usage job will run at PST 00:15 and generate usage records for the 24 hours from 00:00:00 GMT to 23:59:59 GMT:
|
||
</div>
|
||
|
||
<pre class="programlisting">usage.stats.job.exec.time = 00:15
|
||
usage.execution.timezone = PST
|
||
usage.aggregation.timezone = GMT
|
||
</pre>
|
||
<div class="para">
|
||
Valid values for the time zone are specified in <a class="xref" href="time-zones.html">Appendix A, <em>Time Zones</em></a>
|
||
</div>
|
||
<div class="para">
|
||
Default: GMT
|
||
</div>
|
||
|
||
</td></tr><tr><td align="left">
|
||
<div class="para">
|
||
usage.execution.timezone
|
||
</div>
|
||
</td><td align="left">
|
||
<div class="para">
|
||
The time zone of usage.stats.job.exec.time. Valid values for the time zone are specified in <a class="xref" href="time-zones.html">Appendix A, <em>Time Zones</em></a>
|
||
</div>
|
||
<div class="para">
|
||
Default: The time zone of the management server.
|
||
</div>
|
||
|
||
</td></tr><tr><td align="left">
|
||
<div class="para">
|
||
usage.sanity.check.interval
|
||
</div>
|
||
</td><td align="left">
|
||
<div class="para">
|
||
The number of days between sanity checks. Set this in order to periodically search for records with erroneous data before issuing customer invoices. For example, this checks for VM usage records created after the VM was destroyed, and similar checks for templates, volumes, and so on. It also checks for usage times longer than the aggregation range. If any issue is found, the alert ALERT_TYPE_USAGE_SANITY_RESULT = 21 is sent.
|
||
</div>
|
||
</td></tr><tr><td align="left">
|
||
<div class="para">
|
||
usage.stats.job.aggregation.range
|
||
</div>
|
||
</td><td align="left">
|
||
<div class="para">
|
||
The time period in minutes between Usage Server processing jobs. For example, if you set it to 1440, the Usage Server will run once per day. If you set it to 600, it will run every ten hours. In general, when a Usage Server job runs, it processes all events generated since usage was last run.
|
||
</div>
|
||
<div class="para">
|
||
There is special handling for the case of 1440 (once per day). In this case the Usage Server does not necessarily process all records since Usage was last run. CloudStack assumes that you require processing once per day for the previous, complete day’s records. For example, if the current day is October 7, then it is assumed you would like to process records for October 6, from midnight to midnight. CloudStack assumes this "midnight to midnight" is relative to the usage.execution.timezone.
|
||
</div>
|
||
<div class="para">
|
||
Default: 1440
|
||
</div>
|
||
|
||
</td></tr><tr><td align="left">
|
||
<div class="para">
|
||
usage.stats.job.exec.time
|
||
</div>
|
||
</td><td align="left">
|
||
<div class="para">
|
||
The time when the Usage Server processing will start. It is specified in 24-hour format (HH:MM) in the time zone of the server, which should be GMT. For example, to start the Usage job at 10:30 GMT, enter "10:30".
|
||
</div>
|
||
<div class="para">
|
||
If usage.stats.job.aggregation.range is also set, and its value is not 1440, then its value will be added to usage.stats.job.exec.time to get the time to run the Usage Server job again. This is repeated until 24 hours have elapsed, and the next day's processing begins again at usage.stats.job.exec.time.
|
||
</div>
|
||
<div class="para">
|
||
Default: 00:15.
|
||
</div>
|
||
|
||
</td></tr></tbody></table></div><div class="para">
|
||
For example, suppose that your server is in GMT, your user population is predominantly in the East Coast of the United States, and you would like to process usage records every night at 2 AM local (EST) time. Choose these settings:
|
||
</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
|
||
enable.usage.server = true
|
||
</div></li><li class="listitem"><div class="para">
|
||
usage.execution.timezone = America/New_York
|
||
</div></li><li class="listitem"><div class="para">
|
||
usage.stats.job.exec.time = 07:00. This will run the Usage job at 2:00 AM EST. Note that this will shift by an hour as the East Coast of the U.S. enters and exits Daylight Savings Time.
|
||
</div></li><li class="listitem"><div class="para">
|
||
usage.stats.job.aggregation.range = 1440
|
||
</div></li></ul></div><div class="para">
|
||
With this configuration, the Usage job will run every night at 2 AM EST and will process records for the previous day’s midnight-midnight as defined by the EST (America/New_York) time zone.
|
||
</div><div class="note"><div class="admonition_header"><h2>Note</h2></div><div class="admonition"><div class="para">
|
||
Because the special value 1440 has been used for usage.stats.job.aggregation.range, the Usage Server will ignore the data between midnight and 2 AM. That data will be included in the next day's run
|
||
</div></div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="work-with-usage.html"><strong>Prev</strong>Chapter 14. Working with Usage</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="set-usage-limit.html"><strong>Next</strong>14.2. Setting Usage Limits</a></li></ul></body></html>
|