~notmyname/swift/deslogging

« back to all changes in this revision

Viewing changes to doc/source/overview_stats.rst

  • Committer: Tarmac
  • Author(s): David Goetz, Jay Payne
  • Date: 2011-05-18 15:48:17 UTC
  • mfrom: (286.3.22 containerstat)
  • Revision ID: tarmac-20110518154817-n03d5aig142496q2
Adding container stats collector, unit tests, and refactoring some of the stats code.  There will have to be changes to both the swift and rackswift conf files before this can be released.  Please DO NOT approve this branch for merge until glange's stats stuff is all ready to go.  gracias.

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
    local1.*                ~
103
103
 
104
104
#. Edit /etc/rsyslog.conf and make the following change::
105
 
      
106
105
    $PrivDropToGroup adm
107
106
 
108
107
#. `mkdir -p /var/log/swift/hourly`
113
112
#. Relogin to let the group change take effect.
114
113
#. Create `/etc/swift/log-processor.conf`::
115
114
 
116
 
                [log-processor]
117
 
                swift_account = <your-stats-account-hash>
118
 
                user = <your-user-name>
119
 
 
120
 
                [log-processor-access]
121
 
                swift_account = <your-stats-account-hash>
122
 
                container_name = log_data
123
 
                log_dir = /var/log/swift/hourly/
124
 
                source_filename_format = %Y%m%d%H
125
 
                class_path = swift.stats.access_processor.AccessLogProcessor
126
 
                user = <your-user-name>
127
 
 
128
 
                [log-processor-stats]
129
 
                swift_account = <your-stats-account-hash>
130
 
                container_name = account_stats
131
 
                log_dir = /var/log/swift/stats/
132
 
                source_filename_format = %Y%m%d%H_*
133
 
                class_path = swift.stats.stats_processor.StatsLogProcessor
134
 
                account_server_conf = /etc/swift/account-server/1.conf
135
 
                user = <your-user-name>
 
115
    [log-processor]
 
116
    swift_account = <your-stats-account-hash>
 
117
    user = <your-user-name>
 
118
 
 
119
    [log-processor-access]
 
120
    swift_account = <your-stats-account-hash>
 
121
    container_name = log_data
 
122
    log_dir = /var/log/swift/hourly/
 
123
    source_filename_pattern = ^
 
124
        (?P<year>[0-9]{4})
 
125
        (?P<month>[0-1][0-9])
 
126
        (?P<day>[0-3][0-9])
 
127
        (?P<hour>[0-2][0-9])
 
128
        .*$
 
129
    class_path = swift.stats.access_processor.AccessLogProcessor
 
130
    user = <your-user-name>
 
131
 
 
132
    [log-processor-stats]
 
133
    swift_account = <your-stats-account-hash>
 
134
    container_name = account_stats
 
135
    log_dir = /var/log/swift/stats/
 
136
    class_path = swift.stats.stats_processor.StatsLogProcessor
 
137
    devices = /srv/1/node
 
138
    mount_check = false
 
139
    user = <your-user-name>
 
140
 
 
141
    [log-processor-container-stats]
 
142
    swift_account = <your-stats-account-hash>
 
143
    container_name = container_stats
 
144
    log_dir = /var/log/swift/stats/
 
145
    class_path = swift.stats.stats_processor.StatsLogProcessor
 
146
    processable = false
 
147
    devices = /srv/1/node
 
148
    mount_check = false
 
149
    user = <your-user-name>
136
150
 
137
151
#. Add the following under [app:proxy-server] in `/etc/swift/proxy-server.conf`::
138
152
 
139
 
                log_facility = LOG_LOCAL1
 
153
    log_facility = LOG_LOCAL1
140
154
 
141
155
#. Create a `cron` job to run once per hour to create the stats logs. In
142
156
   `/etc/cron.d/swift-stats-log-creator`::
143
157
 
144
 
                0 * * * * <your-user-name> swift-account-stats-logger /etc/swift/log-processor.conf
145
 
 
146
 
#. Create a `cron` job to run once per hour to upload the stats logs. In
147
 
   `/etc/cron.d/swift-stats-log-uploader`::
148
 
 
149
 
        10 * * * * <your-user-name> swift-log-uploader /etc/swift/log-processor.conf stats
 
158
    0 * * * * <your-user-name> /usr/local/bin/swift-account-stats-logger /etc/swift/log-processor.conf
 
159
 
 
160
#. Create a `cron` job to run once per hour to create the container stats logs. In
 
161
   `/etc/cron.d/swift-container-stats-log-creator`::
 
162
 
 
163
    5 * * * * <your-user-name> /usr/local/bin/swift-container-stats-logger /etc/swift/log-processor.conf
 
164
 
 
165
#. Create a `cron` job to run once per hour to upload the stats logs. In
 
166
   `/etc/cron.d/swift-stats-log-uploader`::
 
167
 
 
168
    10 * * * * <your-user-name> /usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf stats
 
169
 
 
170
#. Create a `cron` job to run once per hour to upload the stats logs. In
 
171
   `/etc/cron.d/swift-stats-log-uploader`::
 
172
 
 
173
    15 * * * * <your-user-name> /usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf container-stats
150
174
 
151
175
#. Create a `cron` job to run once per hour to upload the access logs. In
152
176
   `/etc/cron.d/swift-access-log-uploader`::
153
177
 
154
 
        5 * * * * <your-user-name> swift-log-uploader /etc/swift/log-processor.conf access
 
178
    5 * * * * <your-user-name> /usr/local/bin/swift-log-uploader /etc/swift/log-processor.conf access
155
179
 
156
180
#. Create a `cron` job to run once per hour to process the logs. In
157
181
   `/etc/cron.d/swift-stats-processor`::
158
182
 
159
 
        30 * * * * <your-user-name> swift-log-stats-collector /etc/swift/log-processor.conf
 
183
    30 * * * * <your-user-name> /usr/local/bin/swift-log-stats-collector /etc/swift/log-processor.conf
160
184
 
161
185
After running for a few hours, you should start to see .csv files in the
162
186
log_processing_data container in the swift stats account that was created