Adds documentation how to the SAIO on how to setup rsyslog to have separate logs for each node
This commit is contained in:
@@ -182,6 +182,46 @@ Setting up rsync
|
||||
|
||||
#. `service rsync restart`
|
||||
|
||||
---------------------------------------------------
|
||||
Optional: Setting up rsyslog for individual logging
|
||||
---------------------------------------------------
|
||||
|
||||
#. Create /etc/rsyslog.d/10-swift.conf::
|
||||
|
||||
# Uncomment the following to have a log containing all logs together
|
||||
#local1,local2,local3,local4,local5.* /var/log/swift/all.log
|
||||
|
||||
# Uncomment the following to have hourly proxy logs for stats processing
|
||||
#$template HourlyProxyLog,"/var/log/swift/hourly/%$YEAR%%$MONTH%%$DAY%%$HOUR%"
|
||||
#local1.*;local1.!notice ?HourlyProxyLog
|
||||
|
||||
local1.*;local1.!notice /var/log/swift/proxy.log
|
||||
local1.notice /var/log/swift/proxy.error
|
||||
local1.* ~
|
||||
|
||||
local2.*;local2.!notice /var/log/swift/storage1.log
|
||||
local2.notice /var/log/swift/storage1.error
|
||||
local2.* ~
|
||||
|
||||
local3.*;local3.!notice /var/log/swift/storage2.log
|
||||
local3.notice /var/log/swift/storage2.error
|
||||
local3.* ~
|
||||
|
||||
local4.*;local4.!notice /var/log/swift/storage3.log
|
||||
local4.notice /var/log/swift/storage3.error
|
||||
local4.* ~
|
||||
|
||||
local5.*;local5.!notice /var/log/swift/storage4.log
|
||||
local5.notice /var/log/swift/storage4.error
|
||||
local5.* ~
|
||||
|
||||
#. Edit /etc/rsyslog.conf and make the following change::
|
||||
|
||||
$PrivDropToGroup adm
|
||||
|
||||
#. `mkdir -p /var/log/swift/hourly`
|
||||
#. `chown -R syslog.adm /var/log/swift`
|
||||
#. `service rsyslog restart`
|
||||
|
||||
------------------------------------------------
|
||||
Getting the code and setting up test environment
|
||||
@@ -236,6 +276,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
[DEFAULT]
|
||||
bind_port = 8080
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL1
|
||||
|
||||
[pipeline:main]
|
||||
# For DevAuth:
|
||||
@@ -276,6 +317,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6012
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL2
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = account-server
|
||||
@@ -297,6 +339,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6022
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL3
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = account-server
|
||||
@@ -318,6 +361,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6032
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL4
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = account-server
|
||||
@@ -339,6 +383,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6042
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL5
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = account-server
|
||||
@@ -360,6 +405,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6011
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL2
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = container-server
|
||||
@@ -381,6 +427,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6021
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL3
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = container-server
|
||||
@@ -402,6 +449,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6031
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL4
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = container-server
|
||||
@@ -423,6 +471,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6041
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL5
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = container-server
|
||||
@@ -445,6 +494,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6010
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL2
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = object-server
|
||||
@@ -466,6 +516,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6020
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL3
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = object-server
|
||||
@@ -487,6 +538,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6030
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL4
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = object-server
|
||||
@@ -508,6 +560,7 @@ Sample configuration files are provided with all defaults in line-by-line commen
|
||||
mount_check = false
|
||||
bind_port = 6040
|
||||
user = <your-user-name>
|
||||
log_facility = LOG_LOCAL5
|
||||
|
||||
[pipeline:main]
|
||||
pipeline = object-server
|
||||
@@ -531,6 +584,7 @@ Setting up scripts for running Swift
|
||||
#!/bin/bash
|
||||
|
||||
swift-init all stop
|
||||
find /var/log/swift -type f -exec rm -f {} \;
|
||||
sudo umount /mnt/sdb1
|
||||
sudo mkfs.xfs -f -i size=1024 /dev/sdb1
|
||||
sudo mount /mnt/sdb1
|
||||
|
||||
@@ -89,45 +89,28 @@ Running the stats system on SAIO
|
||||
#. Create a swift account to use for storing stats information, and note the
|
||||
account hash. The hash will be used in config files.
|
||||
|
||||
#. Install syslog-ng::
|
||||
#. Edit /etc/rsyslog.d/10-swift.conf::
|
||||
|
||||
sudo apt-get install syslog-ng
|
||||
# Uncomment the following to have a log containing all logs together
|
||||
#local1,local2,local3,local4,local5.* /var/log/swift/all.log
|
||||
|
||||
#. Add the following to the end of `/etc/syslog-ng/syslog-ng.conf`::
|
||||
$template HourlyProxyLog,"/var/log/swift/hourly/%$YEAR%%$MONTH%%$DAY%%$HOUR%"
|
||||
local1.*;local1.!notice ?HourlyProxyLog
|
||||
|
||||
# Added for swift logging
|
||||
destination df_local1 { file("/var/log/swift/proxy.log" owner(<username>) group(<groupname>)); };
|
||||
destination df_local1_err { file("/var/log/swift/proxy.error" owner(<username>) group(<groupname>)); };
|
||||
destination df_local1_hourly { file("/var/log/swift/hourly/$YEAR$MONTH$DAY$HOUR" owner(<username>) group(<groupname>)); };
|
||||
filter f_local1 { facility(local1) and level(info); };
|
||||
local1.*;local1.!notice /var/log/swift/proxy.log
|
||||
local1.notice /var/log/swift/proxy.error
|
||||
local1.* ~
|
||||
|
||||
filter f_local1_err { facility(local1) and not level(info); };
|
||||
|
||||
# local1.info -/var/log/swift/proxy.log
|
||||
# write to local file and to remove log server
|
||||
log {
|
||||
source(s_all);
|
||||
filter(f_local1);
|
||||
destination(df_local1);
|
||||
destination(df_local1_hourly);
|
||||
};
|
||||
|
||||
# local1.error -/var/log/swift/proxy.error
|
||||
# write to local file and to remove log server
|
||||
log {
|
||||
source(s_all);
|
||||
filter(f_local1_err);
|
||||
destination(df_local1_err);
|
||||
};
|
||||
|
||||
#. Restart syslog-ng
|
||||
|
||||
#. Create the log directories::
|
||||
|
||||
mkdir /var/log/swift/hourly
|
||||
mkdir /var/log/swift/stats
|
||||
chown -R <username>:<groupname> /var/log/swift
|
||||
#. Edit /etc/rsyslog.conf and make the following change::
|
||||
|
||||
$PrivDropToGroup adm
|
||||
|
||||
#. `mkdir -p /var/log/swift/hourly`
|
||||
#. `chown -R syslog.adm /var/log/swift`
|
||||
#. `chmod 775 /var/log/swift /var/log/swift/hourly`
|
||||
#. `service rsyslog restart`
|
||||
#. `usermod -a -G adm <your-user-name>`
|
||||
#. Relogin to let the group change take effect.
|
||||
#. Create `/etc/swift/log-processor.conf`::
|
||||
|
||||
[log-processor]
|
||||
|
||||
Reference in New Issue
Block a user