Make Heka collect Swift logs

Partially implements: blueprint heka
Change-Id: I893a0c4a4cab9d4d98821634ddd2ff67015c4e3f
This commit is contained in:
Éric Lemoine 2016-02-12 12:43:42 +01:00 committed by SamYaple
parent a2b130d6ba
commit 88633684a1
9 changed files with 59 additions and 63 deletions

View File

@ -34,3 +34,24 @@
- "openstack"
- "mariadb"
- "keystone"
- name: Copying over heka swift config files
template:
src: "heka-swift.toml.j2"
dest: "{{ node_config_directory }}/heka/heka-{{ item }}.toml"
with_items:
- "swift-account-auditor"
- "swift-account-reaper"
- "swift-account-replicator"
- "swift-account-server"
- "swift-container-auditor"
- "swift-container-replicator"
- "swift-container-server"
- "swift-container-updater"
- "swift-object-auditor"
- "swift-object-expirer"
- "swift-object-replicator"
- "swift-object-server"
- "swift-object-updater"
- "swift-proxy-server"
- "swift-rsyncd"

View File

@ -0,0 +1,8 @@
# Swift writes its logs to Syslog, so the generic Syslog input set in
# heka-global.toml.j2 is used.
[{{ item }}_file_output]
type = "FileOutput"
message_matcher = "Type == 'Syslog' && Fields[programname] == '{{ item }}'"
path = "/var/log/kolla/swift/{{ item }}.log"
encoder = "syslog_encoder"

View File

@ -1,3 +1,4 @@
{% set swift_services = ["swift-account-auditor", "swift-account-reaper", "swift-account-replicator", "swift-account-server", "swift-container-auditor", "swift-container-replicator", "swift-container-server", "swift-container-updater", "swift-object-auditor", "swift-object-expirer", "swift-object-replicator", "swift-object-server", "swift-object-updater", "swift-proxy-server", "swift-rsyncd"] %}
{
"command": "/usr/bin/hekad -config=/etc/heka/",
"config_files": [
@ -36,6 +37,16 @@
"dest": "/etc/heka/heka-keystone.toml",
"owner": "heka",
"perm": "0600"
},
{% for swift_service in swift_services %}
{
"source": "{{ container_config_directory }}/heka-{{ swift_service }}.toml",
"dest": "/etc/heka/heka-{{ swift_service }}.toml",
"owner": "heka",
"perm": "0600"
}
{%- if not loop.last %},{% endif %}
{% endfor %}
]
}

View File

@ -28,54 +28,6 @@ $template CinderSchedulerFile,"/var/log/cinder/cinder-scheduler.log"
$template CinderVolumeFile,"/var/log/cinder/cinder-volume.log"
:syslogtag,contains,"cinder-volume" ?CinderVolumeFile
$template SwiftAccountFile,"/var/log/swift/swift-account-server.log"
:syslogtag,contains,"swift-account-server" ?SwiftAccountFile
$template SwiftAccountAuditorFile,"/var/log/swift/swift-account-auditor.log"
:syslogtag,contains,"swift-account-auditor" ?SwiftAccountAuditorFile
$template SwiftAccountServerFile,"/var/log/swift/swift-account-server.log"
:syslogtag,contains,"swift-account-server" ?SwiftAccountServerFile
$template SwiftContainerReplicatorFile,"/var/log/swift/swift-container-replicator.log"
:syslogtag,contains,"swift-container-replicator" ?SwiftContainerReplicatorFile
$template SwiftObjectAuditorFile,"/var/log/swift/swift-object-auditor.log"
:syslogtag,contains,"swift-object-auditor" ?SwiftObjectAuditorFile
$template SwiftObjectReplicatorFile,"/var/log/swift/swift-object-replicator.log"
:syslogtag,contains,"swift-object-replicator" ?SwiftObjectReplicatorFile
$template SwiftProxyServerFile,"/var/log/swift/swift-proxy-server.log"
:syslogtag,contains,"swift-proxy-server" ?SwiftProxyServerFile
$template SwiftAccountReaperFile,"/var/log/swift/swift-account-reaper.log"
:syslogtag,contains,"swift-account-reaper" ?SwiftAccountReaperFile
$template SwiftContainerServerFile,"/var/log/swift/swift-container-server.log"
:syslogtag,contains,"swift-container-server" ?SwiftContainerServerFile
$template SwiftObjectServerFile,"/var/log/swift/swift-object-server.log"
:syslogtag,contains,"swift-object-server" ?SwiftObjectServerFile
$template SwiftRsyncdFile,"/var/log/swift/swift-rsyncd.log"
:syslogtag,contains,"swift-rsyncd" ?SwiftRsyncdFile
$template SwiftAccountReplicatorFile,"/var/log/swift/swift-account-replicator.log"
:syslogtag,contains,"swift-account-replicator" ?SwiftAccountReplicatorFile
$template SwiftContainerAuditorFile,"/var/log/swift/swift-container-auditor.log"
:syslogtag,contains,"swift-container-auditor" ?SwiftContainerAuditorFile
$template SwiftContainerUpdaterFile,"/var/log/swift/swift-container-updater.log"
:syslogtag,contains,"swift-container-updater" ?SwiftContainerUpdaterFile
$template SwiftObjectExpirerFile,"/var/log/swift/swift-object-expirer.log"
:syslogtag,contains,"swift-object-expirer" ?SwiftObjectExpirerFile
$template SwiftObjectUpdaterFile,"/var/log/swift/swift-object-updater.log"
:syslogtag,contains,"swift-object-updater" ?SwiftObjectUpdaterFile
$template MuranoEngineFile,"/var/log/murano/murano-engine.log"
:syslogtag,contains,"murano-engine" ?MuranoEngineFile

View File

@ -40,7 +40,7 @@
volumes:
- "{{ node_config_directory }}/swift-rsyncd/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname not in groups['swift-proxy-server']
- name: Starting swift-proxy-server container
@ -52,7 +52,7 @@
volumes:
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-proxy-server/:{{ container_config_directory }}/:ro"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-proxy-server']
- name: Starting swift-account-server container
@ -65,7 +65,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-auditor container
@ -78,7 +78,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-replicator container
@ -91,7 +91,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-account-reaper container
@ -104,7 +104,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-account-reaper/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-account-server']
- name: Starting swift-container-server container
@ -117,7 +117,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-auditor container
@ -130,7 +130,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-replicator container
@ -143,7 +143,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-container-updater container
@ -156,7 +156,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-container-updater/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-container-server']
- name: Starting swift-object-server container
@ -169,7 +169,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-server/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-auditor container
@ -182,7 +182,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-auditor/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-replicator container
@ -195,7 +195,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-replicator/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-updater container
@ -208,7 +208,7 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-updater/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-object-server']
- name: Starting swift-object-expirer container
@ -221,5 +221,5 @@
- "{{ node_config_directory }}/swift/:/var/lib/kolla/swift/:ro"
- "{{ node_config_directory }}/swift-object-expirer/:{{ container_config_directory }}/:ro"
- "{{ swift_devices_mount_point }}:{{ swift_devices_mount_point }}"
- "rsyslog_socket:/var/lib/kolla/rsyslog/"
- "heka_socket:/var/lib/kolla/heka/"
when: inventory_hostname in groups['swift-object-server']

View File

@ -3,6 +3,7 @@ bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['a
bind_port = {{ swift_account_server_port }}
devices = {{ swift_devices_mount_point }}
mount_check = false
log_address = /var/lib/kolla/heka/log
log_name = {{ service_name }}
log_facility = LOG_LOCAL0
log_level = warning

View File

@ -3,6 +3,7 @@ bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['a
bind_port = {{ swift_container_server_port }}
devices = {{ swift_devices_mount_point }}
mount_check = false
log_address = /var/lib/kolla/heka/log
log_name = {{ service_name }}
log_facility = LOG_LOCAL0
log_level = warning

View File

@ -4,6 +4,7 @@ bind_port = {{ swift_object_server_port }}
devices = {{ swift_devices_mount_point }}
mount_check = false
log_address = /var/lib/kolla/heka/log
log_name = {{ service_name }}
log_facility = LOG_LOCAL0
log_level = warning

View File

@ -2,6 +2,7 @@
bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
bind_port = {{ swift_proxy_server_port }}
log_address = /var/lib/kolla/heka/log
log_name = {{ service_name }}
log_facility = LOG_LOCAL0
log_level = warning