Fill the diff of installed path among distro in docs

Installed Path is the below.

- On Ubuntu(by apt), /usr/bin
- On Ubuntu(by pip), /usr/local/bin
- On CentOS(by yum), /bin
- On OpenSUSE(by zypper), /usr/bin

Fill the difference in install/user documents.

Change-Id: Idf973ffe99663ed01e84c534309dea219cd71c2b
This commit is contained in:
Hajime Kondo 2018-05-10 10:33:29 +00:00
parent 4daebba9fa
commit 93aaa2e511
2 changed files with 37 additions and 22 deletions

View File

@ -21,24 +21,28 @@ environment.
local1.notice /var/log/swift/proxy.error local1.notice /var/log/swift/proxy.error
local1.* ~ local1.* ~
#. Edit ``/etc/rsyslog.conf`` and make the following change:: #. On *Debian/Ubuntu*, edit ``/etc/rsyslog.conf`` and make the following change::
$PrivDropToGroup adm $PrivDropToGroup adm
#. ``mkdir -p /var/log/swift/hourly`` #. ``mkdir -p /var/log/swift/hourly``
#. ``chown -R syslog.adm /var/log/swift`` #. On *Debian/Ubuntu*, ``chown -R syslog.adm /var/log/swift``
#. ``chmod 775 /var/log/swift /var/log/swift/hourly`` #. ``chmod 775 /var/log/swift /var/log/swift/hourly``
#. ``service rsyslog restart`` #. ``systemctl restart rsyslog``
#. ``usermod -a -G adm <your-user-name>`` #. ``usermod -a -G adm <your-user-name>``
#. Relogin to let the group change take effect. #. Relogin to let the group change take effect.
#. Create ``/etc/swift/log-processor.conf``:: #. Create ``/etc/swift/log-processor.conf``::
[log-processor] [DEFAULT]
swift_account = <your-stats-account-hash> swift_account = <your-stats-account-hash>
user = <your-user-name> user = <your-user-name>
new_log_cutoff = <log-cutoff-sec>
[log-processor]
container_name = log_processing_data
format_type = csv
[log-processor-access] [log-processor-access]
swift_account = <your-stats-account-hash>
container_name = log_data container_name = log_data
log_dir = /var/log/swift/hourly/ log_dir = /var/log/swift/hourly/
source_filename_pattern = ^ source_filename_pattern = ^
@ -48,60 +52,61 @@ environment.
(?P<hour>[0-2][0-9]) (?P<hour>[0-2][0-9])
.*$ .*$
class_path = slogging.access_processor.AccessLogProcessor class_path = slogging.access_processor.AccessLogProcessor
user = <your-user-name>
[log-processor-stats] [log-processor-stats]
swift_account = <your-stats-account-hash>
container_name = account_stats container_name = account_stats
log_dir = /var/log/swift/stats/ log_dir = /var/log/swift/stats/
class_path = slogging.stats_processor.StatsLogProcessor class_path = slogging.stats_processor.StatsLogProcessor
devices = /srv/1/node devices = /srv/1/node
mount_check = false mount_check = false
user = <your-user-name>
[log-processor-container-stats] [log-processor-container-stats]
swift_account = <your-stats-account-hash>
container_name = container_stats container_name = container_stats
log_dir = /var/log/swift/stats/ log_dir = /var/log/swift/stats/
class_path = slogging.stats_processor.StatsLogProcessor class_path = slogging.stats_processor.StatsLogProcessor
processable = false processable = false
devices = /srv/1/node devices = /srv/1/node
mount_check = false mount_check = false
user = <your-user-name>
#. Add the following under [app:proxy-server] in ``/etc/swift/proxy-server.conf``:: #. Add the following under [app:proxy-server] in ``/etc/swift/proxy-server.conf``::
log_facility = LOG_LOCAL1 log_facility = LOG_LOCAL1
#. Run the following command to get slogging installed path.:
``dirname $(which swift-log-uploader)``
The ``<installed-path>`` on cron.d/* below shall be replaced with the above results.
#. Create a ``cron`` job to run once per hour to create the stats logs. In #. Create a ``cron`` job to run once per hour to create the stats logs. In
``/etc/cron.d/swift-stats-log-creator``:: ``/etc/cron.d/swift-stats-log-creator``::
0 * * * * <your-user-name> /usr/local/bin/swift-account-stats-logger /etc/swift/log-processor.conf 0 * * * * <your-user-name> <installed-path>/swift-account-stats-logger /etc/swift/log-processor.conf
#. Create a ``cron`` job to run once per hour to create the container stats logs. In #. Create a ``cron`` job to run once per hour to create the container stats logs. In
``/etc/cron.d/swift-container-stats-log-creator``:: ``/etc/cron.d/swift-container-stats-log-creator``::
5 * * * * <your-user-name> /usr/local/bin/swift-container-stats-logger /etc/swift/log-processor.conf 5 * * * * <your-user-name> <installed-path>/swift-container-stats-logger /etc/swift/log-processor.conf
#. Create a ``cron`` job to run once per hour to upload the stats logs. In #. Create a ``cron`` job to run once per hour to upload the stats logs. In
``/etc/cron.d/swift-stats-log-uploader``:: ``/etc/cron.d/swift-stats-log-uploader``::
10 * * * * <your-user-name> /usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf stats 10 * * * * <your-user-name> <installed-path>/swift-log-uploader /etc/swift/log-processor.conf stats
#. Create a ``cron`` job to run once per hour to upload the stats logs. In #. Create a ``cron`` job to run once per hour to upload the stats logs. In
``/etc/cron.d/swift-stats-log-uploader``:: ``/etc/cron.d/swift-stats-log-uploader``::
15 * * * * <your-user-name> /usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf container-stats 15 * * * * <your-user-name> <installed-path>/swift-log-uploader /etc/swift/log-processor.conf container-stats
#. Create a ``cron`` job to run once per hour to upload the access logs. In #. Create a ``cron`` job to run once per hour to upload the access logs. In
``/etc/cron.d/swift-access-log-uploader``:: ``/etc/cron.d/swift-access-log-uploader``::
5 * * * * <your-user-name> /usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf access 5 * * * * <your-user-name> <installed-path>/swift-log-uploader /etc/swift/log-processor.conf access
#. Create a ``cron`` job to run once per hour to process the logs. In #. Create a ``cron`` job to run once per hour to process the logs. In
``/etc/cron.d/swift-stats-processor``:: ``/etc/cron.d/swift-stats-processor``::
30 * * * * <your-user-name> /usr/local/bin/swift-log-stats-collector /etc/swift/log-processor.conf 30 * * * * <your-user-name> <installed-path>/swift-log-stats-collector /etc/swift/log-processor.conf
After running for a few hours, you should start to see .csv files in the After running for a few hours, you should start to see .csv files in the
``log_processing_data`` container in the swift stats account that was created ``log_processing_data`` container in the swift stats account that was created

View File

@ -4,6 +4,16 @@ How slogging process Swift's logs
This page shows you how slogging process logs on OpenStack Swift. This page shows you how slogging process logs on OpenStack Swift.
Get Installed Path
~~~~~~~~~~~~~~~~~~
You can run the following command to get slogging installed path.::
dirname $(which swift-log-uploader)
The ``<installed-path>`` on this page shall be replaced with the above results.
Log Processing plugins Log Processing plugins
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
@ -37,9 +47,9 @@ Basically there are three kind of logs.
You can pass plugin's name as argument of ``swift-log-uploader`` like following.:: You can pass plugin's name as argument of ``swift-log-uploader`` like following.::
/usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf access <installed-path>/swift-log-uploader /etc/swift/log-processor.conf access
/usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf stats <installed-path>/swift-log-uploader /etc/swift/log-processor.conf stats
/usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf container-stats <installed-path>/swift-log-uploader /etc/swift/log-processor.conf container-stats
You can set above command as cron job so that you can collect those kind of logs in regular basis. You can set above command as cron job so that you can collect those kind of logs in regular basis.
@ -67,7 +77,7 @@ This allows easy log rotation and easy per-hour log processing.
To upload access logs, you can set cron like following:: To upload access logs, you can set cron like following::
/usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf access <installed-path>/swift-log-uploader /etc/swift/log-processor.conf access
.. _stats-logs: .. _stats-logs:
@ -98,8 +108,8 @@ the container dbs.
To upload account stats logs and container stats logs, you can set cron like following:: To upload account stats logs and container stats logs, you can set cron like following::
/usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf container-stats <installed-path>/swift-log-uploader /etc/swift/log-processor.conf container-stats
/usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf stats <installed-path>/swift-log-uploader /etc/swift/log-processor.conf stats
.. _log-processing: .. _log-processing: