Last active
August 29, 2015 14:19
-
-
Save DirectXMan12/5681d89f4c4a9bf903a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/elements/puppet-stack-config/install.d/02-puppet-stack-config b/elements/puppet-stack-config/install.d/02-puppet-stack-config | |
index 8203b68..9b1a32a 100755 | |
--- a/elements/puppet-stack-config/install.d/02-puppet-stack-config | |
+++ b/elements/puppet-stack-config/install.d/02-puppet-stack-config | |
@@ -52,6 +52,7 @@ context = { | |
'UNDERCLOUD_IRONIC_PASSWORD': os.environ.get('UNDERCLOUD_IRONIC_PASSWORD', 'unset'), | |
'UNDERCLOUD_TUSKAR_PASSWORD': os.environ.get('UNDERCLOUD_TUSKAR_PASSWORD', 'unset'), | |
'UNDERCLOUD_DEBUG': os.environ.get('UNDERCLOUD_DEBUG', 'true'), | |
+ 'ENABLE_LOG_AGGREGATION': os.environ.get('ENABLE_LOG_AGGREGATION', 'false'), | |
'KEYSTONE_SIGNING_CERTIFICATE': | |
open(os.path.join(keystone_pki_dir, 'signing_cert.pem')).read(), | |
diff --git a/elements/puppet-stack-config/os-refresh-config/post-configure.d/10-fluentd-iptables b/elements/puppet-stack-config/os-refresh-config/post-configure.d/10-fluentd-iptables | |
new file mode 100644 | |
index 0000000..fc1cf1e | |
--- /dev/null | |
+++ b/elements/puppet-stack-config/os-refresh-config/post-configure.d/10-fluentd-iptables | |
@@ -0,0 +1,10 @@ | |
+#!/bin/bash | |
+ | |
+set -eux | |
+set -o pipefail | |
+ | |
+ENABLE_LOG_AGGREGATION=$(os-apply-config --key enable-log-aggregation --type raw) | |
+ | |
+if [[ x"$ENABLE_LOG_AGGREGATION" = "xtrue" ]]; then | |
+ add-rule INPUT -m tcp -p tcp --dport 4000 -j ACCEPT | |
+fi | |
diff --git a/elements/puppet-stack-config/package-installs.yaml b/elements/puppet-stack-config/package-installs.yaml | |
index 5e763d7..969d3df 100644 | |
--- a/elements/puppet-stack-config/package-installs.yaml | |
+++ b/elements/puppet-stack-config/package-installs.yaml | |
@@ -1,3 +1,6 @@ | |
os-cloud-config: | |
pystache: | |
python-oslo-concurrency: | |
+rubygem-fluent-plugin-elasticsearch: | |
+fluentd: | |
+elasticsearch: | |
diff --git a/elements/puppet-stack-config/puppet-stack-config.pp b/elements/puppet-stack-config/puppet-stack-config.pp | |
index cdbad09..4cdead6 100644 | |
--- a/elements/puppet-stack-config/puppet-stack-config.pp | |
+++ b/elements/puppet-stack-config/puppet-stack-config.pp | |
@@ -341,3 +341,49 @@ package{'python-tuskarclient': } | |
# tempest | |
# TODO: when puppet-tempest supports install by package, do that instead | |
package{'openstack-tempest-juno': } | |
+ | |
+# log aggregation | |
+if hiera('enable_log_aggregation') { | |
+ | |
+ # fluentd collector | |
+ | |
+ # We're installing from yum, so we don't use the | |
+ # fluentd::install_plugin directive | |
+ package {'rubygem-fluent-plugin-elasticsearch': | |
+ ensure => 'installed', | |
+ } | |
+ | |
+ Package['fluentd'] -> Package['rubygem-fluent-plugin-elasticsearch'] -> Class['fluentd::service'] | |
+ | |
+ class {'fluentd': | |
+ package_name => 'fluentd', | |
+ install_repo => false, | |
+ service_name => 'fluentd', | |
+ } | |
+ | |
+ fluentd::source { 'collector-input': | |
+ config => { | |
+ 'type' => 'forward', | |
+ 'port' => '4000', | |
+ 'bind' => '0.0.0.0' | |
+ }, | |
+ notify => Service['fluentd'] | |
+ } | |
+ | |
+ fluentd::match { 'collector-output': | |
+ pattern => '*.**', | |
+ config => { | |
+ 'type' => 'elasticsearch', | |
+ 'host' => 'localhost', | |
+ 'port' => '9200', | |
+ 'logstash_format' => 'true', | |
+ 'flush_interval' => '5s' | |
+ }, | |
+ notify => Service['fluentd'] | |
+ } | |
+ | |
+ # elasticsearch | |
+ class {'elasticsearch': } | |
+ | |
+ elasticsearch::instance {'openstack-logs': } | |
+} | |
diff --git a/elements/puppet-stack-config/puppet-stack-config.yaml.template b/elements/puppet-stack-config/puppet-stack-config.yaml.template | |
index d05b4b1..ce0ac99 100644 | |
--- a/elements/puppet-stack-config/puppet-stack-config.yaml.template | |
+++ b/elements/puppet-stack-config/puppet-stack-config.yaml.template | |
@@ -1,4 +1,5 @@ | |
debug: {{UNDERCLOUD_DEBUG}} | |
+enable_log_aggregation: {{ENABLE_LOG_AGGREGATION}} | |
controller_host: {{LOCAL_IP}} #local-ipv4 | |
ntp::servers: | |
- | |
diff --git a/elements/undercloud-stack-config/config.json.template b/elements/undercloud-stack-config/config.json.template | |
index 6ee50ab..d737ff3 100644 | |
--- a/elements/undercloud-stack-config/config.json.template | |
+++ b/elements/undercloud-stack-config/config.json.template | |
@@ -4,6 +4,7 @@ | |
"puppet-stack-config" | |
]}, | |
"local-ip": "{{LOCAL_IP}}", | |
+ "enable-log-aggregation": "{{ENABLE_LOG_AGGREGATION}}", | |
"masquerade_networks": ["{{MASQUERADE_NETWORK}}"], | |
"neutron": { | |
"dhcp_start": "{{DHCP_START}}", | |
diff --git a/elements/undercloud-stack-config/install.d/02-undercloud-stack-heat-metadata b/elements/undercloud-stack-config/install.d/02-undercloud-stack-heat-metadata | |
index a7a4260..8819354 100755 | |
--- a/elements/undercloud-stack-config/install.d/02-undercloud-stack-heat-metadata | |
+++ b/elements/undercloud-stack-config/install.d/02-undercloud-stack-heat-metadata | |
@@ -29,6 +29,7 @@ context = { | |
'DISCOVERY_RUNBENCH': os.environ.get('DISCOVERY_RUNBENCH', '0'), | |
'UNDERCLOUD_TUSKAR_PASSWORD': os.environ.get('UNDERCLOUD_TUSKAR_PASSWORD', 'unset'), | |
'UNDERCLOUD_IRONIC_PASSWORD': os.environ.get('UNDERCLOUD_IRONIC_PASSWORD', 'unset'), | |
+ 'ENABLE_LOG_AGGREGATION': os.environ.get('ENABLE_LOG_AGGREGATION', 'false'), | |
} | |
with open(template) as f: | |
diff --git a/instack.answers.sample b/instack.answers.sample | |
index 5ef7708..7d06244 100644 | |
--- a/instack.answers.sample | |
+++ b/instack.answers.sample | |
@@ -65,6 +65,11 @@ DISCOVERY_PXEIP=192.0.2.1 | |
# Set to 1 to enable | |
DISCOVERY_RUNBENCH=0 | |
+### Enable Log Aggregation ### | |
+# whether or not log aggregation components should be installed | |
+# and configured on the undercloud | |
+ENABLE_LOG_AGGREGATION=false | |
+ | |
### UNDERCLOUD_DEBUG ### | |
# Whether to enable the debug log level for OpenStack services | |
UNDERCLOUD_DEBUG=true | |
diff --git a/scripts/instack-build-images b/scripts/instack-build-images | |
index ec42e8a..d4d8f71 100755 | |
--- a/scripts/instack-build-images | |
+++ b/scripts/instack-build-images | |
@@ -135,6 +135,7 @@ os-net-config \ | |
delorean-repo \ | |
stable-interface-names \ | |
grub2 \ | |
+overcloud-logging \ | |
-p python-psutil,python-debtcollector \ | |
" | |
diff --git a/scripts/instack-deploy-overcloud b/scripts/instack-deploy-overcloud | |
index 25318f0..4fddbb2 100755 | |
--- a/scripts/instack-deploy-overcloud | |
+++ b/scripts/instack-deploy-overcloud | |
@@ -12,6 +12,7 @@ if [ -z "$OS_AUTH_URL" ]; then | |
fi | |
TUSKAR= | |
+LOG_AGGREGATION_SERVER= | |
# Default stack create timeout, in minutes | |
# Note heat defaults to 60mins, which may not be enough when | |
@@ -25,13 +26,14 @@ function show_options () { | |
echo "Deploys an Overcloud." | |
echo | |
echo "Options:" | |
- echo " --tuskar -- will use tuskar for building the heat Template" | |
- echo " --timeout -- create timeout in minutes, default $TIMEOUT" | |
+ echo " --tuskar -- will use tuskar for building the heat Template" | |
+ echo " --timeout -- create timeout in minutes, default $TIMEOUT" | |
+ echo " --log-aggregation-server -- set up log aggregation, pointing to the given collection server" | |
echo | |
exit $1 | |
} | |
-TEMP=$(getopt -o ,h -l,tuskar,timeout:,help -n $SCRIPT_NAME -- "$@") | |
+TEMP=$(getopt -o ,h -l,tuskar,timeout:log-aggregation-server:,help -n $SCRIPT_NAME -- "$@") | |
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi | |
# Note the quotes around `$TEMP': they are essential! | |
@@ -41,6 +43,7 @@ while true ; do | |
case "$1" in | |
--tuskar) TUSKAR="1"; shift 1;; | |
--timeout) TIMEOUT="$2"; shift 2;; | |
+ --log-aggregation-server) LOG_AGGREGATION_SERVER="$2"; shift 2;; | |
-h | --help) show_options 0;; | |
--) shift ; break ;; | |
*) echo "Error: unsupported option $1." ; exit 1 ;; | |
@@ -212,6 +215,13 @@ if [ -n "$TUSKAR" ]; then | |
" | |
fi | |
+ if [ -n "$LOG_AGGREGATION_SERVER" ]; then | |
+ export TUSKAR_PARAMETERS="$TUSKAR_PARAMETERS | |
+ -A Compute-1::LogAggregationServer=${LOG_AGGREGATION_SERVER} | |
+ -A Controller-1::LogAggregationServer=${LOG_AGGREGATION_SERVER} | |
+ " | |
+ fi | |
+ | |
# unsure if these should be present with puppet | |
#export TUSKAR_PARAMETERS="$TUSKAR_PARAMETERS | |
#-A cinder-storage-1::CinderPassword=${OVERCLOUD_CINDER_PASSWORD} | |
@@ -339,6 +349,12 @@ else | |
" | |
fi | |
+ if [ -n "$LOG_AGGREGATION_SERVER" ]; then | |
+ export OVERCLOUD_PARAMETERS="$OVERCLOUD_PARAMETERS \ | |
+ -P LogAggregationServer=${LOG_AGGREGATION_SERVER} \ | |
+ " | |
+ fi | |
+ | |
if [ $CEPHSTORAGESCALE -gt 0 ]; then | |
FSID=$(uuidgen) | |
MON_KEY=$(create_cephx_key) | |
diff --git a/scripts/instack-install-undercloud b/scripts/instack-install-undercloud | |
index 228ba25..ec3f78e 100755 | |
--- a/scripts/instack-install-undercloud | |
+++ b/scripts/instack-install-undercloud | |
@@ -83,6 +83,7 @@ export DISCOVERY_IPRANGE | |
export DISCOVERY_PXEIP | |
export DISCOVERY_RUNBENCH | |
export UNDERCLOUD_DEBUG | |
+export ENABLE_LOG_AGGREGATION | |
# Reuse any existing defined passwords. This is important since any users | |
# defined in Keystone already have passwords set. So we don't want to generate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/overcloud-without-mergepy.yaml b/overcloud-without-mergepy.yaml | |
index cd92b60..589f746 100644 | |
--- a/overcloud-without-mergepy.yaml | |
+++ b/overcloud-without-mergepy.yaml | |
@@ -211,6 +211,10 @@ parameters: | |
description: The user password for SNMPd with readonly rights running on all Overcloud nodes | |
type: string | |
hidden: true | |
+ LogAggregationServer: | |
+ default: unset | |
+ description: the IP address or hostname of the log aggregation server | |
+ type: string | |
# Controller-specific params | |
AdminToken: | |
@@ -589,6 +593,7 @@ resources: | |
SwiftReplicas: { get_param: SwiftReplicas} | |
VirtualIP: {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]} | |
PublicVirtualIP: {get_attr: [PublicVirtualIP, fixed_ips, 0, ip_address]} | |
+ LogAggregationServer: {get_param: LogAggregationServer} | |
Compute: | |
type: OS::Heat::ResourceGroup | |
@@ -641,6 +646,7 @@ resources: | |
RabbitUserName: {get_param: RabbitUserName} | |
SnmpdReadonlyUserName: {get_param: SnmpdReadonlyUserName} | |
SnmpdReadonlyUserPassword: {get_param: SnmpdReadonlyUserPassword} | |
+ LogAggregationServer: {get_param: LogAggregationServer} | |
BlockStorage: | |
type: OS::Heat::ResourceGroup | |
diff --git a/puppet/compute-puppet.yaml b/puppet/compute-puppet.yaml | |
index 382682c..c0673d5 100644 | |
--- a/puppet/compute-puppet.yaml | |
+++ b/puppet/compute-puppet.yaml | |
@@ -237,6 +237,10 @@ parameters: | |
default: 'false' | |
description: Set to true to enable package installation via Puppet | |
type: boolean | |
+ LogAggregationServer: | |
+ default: unset | |
+ description: the IP address or hostname of the log aggregation server | |
+ type: string | |
resources: | |
@@ -338,6 +342,7 @@ resources: | |
ceilometer::rabbit_password: {get_input: rabbit_password} | |
ntp::servers: {get_input: ntp_servers} | |
enable_package_install: {get_input: enable_package_install} | |
+ log_aggregation_server: {get_input: log_aggregation_server} | |
NovaComputeDeployment: | |
type: OS::TripleO::SoftwareDeployment | |
@@ -410,6 +415,7 @@ resources: | |
params: | |
server: {get_param: NtpServer} | |
enable_package_install: {get_param: EnablePackageInstall} | |
+ log_aggregation_server: {get_param: LogAggregationServer} | |
outputs: | |
ip_address: | |
diff --git a/puppet/controller-puppet.yaml b/puppet/controller-puppet.yaml | |
index 2282146..b8dd661 100644 | |
--- a/puppet/controller-puppet.yaml | |
+++ b/puppet/controller-puppet.yaml | |
@@ -392,6 +392,10 @@ parameters: | |
default: 'false' | |
description: Set to true to enable package installation via Puppet | |
type: boolean | |
+ LogAggregationServer: | |
+ default: unset | |
+ description: the IP address or hostname of the log aggregation server | |
+ type: string | |
resources: | |
@@ -590,6 +594,7 @@ resources: | |
swift_min_part_hours: {get_param: SwiftMinPartHours} | |
swift_mount_check: {get_param: SwiftMountCheck} | |
enable_package_install: {get_param: EnablePackageInstall} | |
+ log_aggregation_server: {get_param: LogAggregationServer} | |
# Map heat metadata into hiera datafiles | |
ControllerConfig: | |
@@ -781,6 +786,7 @@ resources: | |
tripleo::loadbalancer::public_virtual_interface: {get_input: public_virtual_interface} | |
tripleo::loadbalancer::public_virtual_ip: {get_input: public_virtual_ip} | |
enable_package_install: {get_input: enable_package_install} | |
+ log_aggregation_server: {get_input: log_aggregation_server} | |
outputs: | |
ip_address: | |
diff --git a/puppet/manifests/overcloud_compute.pp b/puppet/manifests/overcloud_compute.pp | |
index ffa55cd..3f9b473 100644 | |
--- a/puppet/manifests/overcloud_compute.pp | |
+++ b/puppet/manifests/overcloud_compute.pp | |
@@ -87,3 +87,70 @@ class { 'snmp': | |
agentaddress => ['udp:161','udp6:[::1]:161'], | |
snmpd_config => [ join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc cron', 'includeAllDisks 10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ], | |
} | |
+ | |
+# log aggregation | |
+define log_openstack_service ( $path ) { | |
+ $log_format = '/(?<time>[^ ]* [^ ]*) (?<pid>[^ ]*) (?<loglevel>[^ ]*) (?<class>[^ ]*) \[(?<context>.*)\] (?<message>.*)/' | |
+ $time_format = '%F %T.%L' | |
+ | |
+ fluentd::source { "input-${name}": | |
+ config => { | |
+ '@type' => 'tail', | |
+ 'path' => $path, | |
+ 'tag' => $name, | |
+ 'format' => $log_format, | |
+ 'time_format' => $time_format | |
+ }, | |
+ notify => Class['fluentd::service'] | |
+ } | |
+ | |
+ # puppet-fluentd doesn't have a good way to represent nested | |
+ # structures (for the '<pair>' # element). | |
+ fluentd::match { "add-metadata-to-${name}": | |
+ pattern => $name, | |
+ config => { | |
+ '@type' => 'add', | |
+ '<pair>' => "\n service ${name}\n hostname \"#{Socket.gethostname}\"\n</pair>" | |
+ }, | |
+ notify => Class['fluentd::service'] | |
+ } | |
+} | |
+ | |
+if hiera("log_aggregation_server", '') { | |
+ package {'rubygem-fluent-plugin-add': | |
+ ensure => 'installed', | |
+ } | |
+ | |
+ Package['fluentd'] -> Package['rubygem-fluent-plugin-add'] -> Class['fluentd::service'] | |
+ | |
+ class {'fluentd': | |
+ package_name => 'fluentd', | |
+ install_repo => false, | |
+ service_name => 'fluentd', | |
+ } | |
+ | |
+ log_openstack_service {'nova.compute': | |
+ path => '/var/log/nova/nova-compute.log' | |
+ } | |
+ | |
+ log_openstack_service {'neutron.openvswitch': | |
+ path => '/var/log/neturon/openvswitch-agent.log' | |
+ } | |
+ | |
+ # TODO(sross): ceilometer? | |
+ | |
+ fluentd::match { 'forward-to-aggregator': | |
+ pattern => 'greped.**', | |
+ priority => '51', | |
+ config => { | |
+ 'type' => 'forward', | |
+ 'heartbeat_type' => 'tcp', | |
+ 'servers' => [{ | |
+ 'name' => hiera("log_aggregation_server"), | |
+ 'host' => hiera("log_aggregation_server"), | |
+ 'port' => '4000' | |
+ }] | |
+ }, | |
+ notify => Class['fluentd::service'] | |
+ } | |
+} | |
diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp | |
index f67eb1c..dd800b7 100644 | |
--- a/puppet/manifests/overcloud_controller.pp | |
+++ b/puppet/manifests/overcloud_controller.pp | |
@@ -171,6 +171,52 @@ if hiera('step') >= 2 { | |
} #END STEP 2 | |
+define log_openstack_service ( $path, $multiline = true ) { | |
+ $log_format = '/(?<time>[^ ]* [^ ]*) (?<pid>[^ ]*) (?<loglevel>[^ ]*) (?<class>[^ ]*) \[(?<context>.*)\] (?<message>.*)/' | |
+ $log_format_firstline = '/(?<time>[^ ]* [^ ]*) (?<pid>[^ ]*) (?<loglevel>[^ ]*) (?<class>[^ ]*) \[(?<context>.*)\] (?<message>.*)/' | |
+ $time_format = '%F %T.%L' | |
+ | |
+ if $multiline { | |
+ # NB(sross): puppet-fluentd can't represent multiple keys with the | |
+ # same name, so we have "format" and " format" | |
+ # (i.e. the space is important) | |
+ fluentd::source { "input-${name}": | |
+ config => { | |
+ '@type' => 'tail', | |
+ 'path' => $path, | |
+ 'tag' => $name, | |
+ ' format' => 'multiline', | |
+ 'format_firstline' => $log_format_firstline, | |
+ 'format' => $log_format, | |
+ 'time_format' => $time_format | |
+ }, | |
+ notify => Class['fluentd::service'] | |
+ } | |
+ } else { | |
+ fluentd::source { "input-${name}": | |
+ config => { | |
+ '@type' => 'tail', | |
+ 'path' => $path, | |
+ 'tag' => $name, | |
+ 'format' => $log_format, | |
+ 'time_format' => $time_format | |
+ }, | |
+ notify => Class['fluentd::service'] | |
+ } | |
+ } | |
+ | |
+ # puppet-fluentd doesn't have a good way to represent nested | |
+ # structures (for the '<pair>' # element). | |
+ fluentd::match { "add-metadata-to-${name}": | |
+ pattern => $name, | |
+ config => { | |
+ '@type' => 'add', | |
+ '<pair>' => "\n service ${name}\n hostname \"#{Socket.gethostname}\"\n</pair>" | |
+ }, | |
+ notify => Class['fluentd::service'] | |
+ } | |
+} | |
+ | |
if hiera('step') >= 3 { | |
include ::keystone | |
@@ -379,4 +425,106 @@ if hiera('step') >= 3 { | |
snmpd_config => [ join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc cron', 'includeAllDisks 10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ], | |
} | |
+ # log aggregation | |
+ if hiera("log_aggregation_server", '') { | |
+ package {'rubygem-fluent-plugin-add': | |
+ ensure => 'installed', | |
+ } | |
+ | |
+ Package['fluentd'] -> Package['rubygem-fluent-plugin-add'] -> Class['fluentd::service'] | |
+ | |
+ class {'fluentd': | |
+ package_name => 'fluentd', | |
+ install_repo => false, | |
+ service_name => 'fluentd', | |
+ } | |
+ | |
+ # Nova | |
+ log_openstack_service { 'nova.api': | |
+ path => '/var/log/nova/nova-api.log' | |
+ } | |
+ | |
+ log_openstack_service { 'nova.cert': | |
+ path => '/var/log/nova/nova-cert.log' | |
+ } | |
+ | |
+ log_openstack_service { 'nova.conductor': | |
+ path => '/var/log/nova/nova-conductor.log' | |
+ } | |
+ | |
+ log_openstack_service { 'nova.consoleauth': | |
+ path => '/var/log/nova/nova-consoleauth.log' | |
+ } | |
+ | |
+ log_openstack_service { 'nova.scheduler': | |
+ path => '/var/log/nova/nova-scheduler.log' | |
+ } | |
+ | |
+ # Neutron | |
+ log_openstack_service { 'neutron.openvswitch': | |
+ multiline => false, | |
+ path => '/var/log/neutron/openvswitch-agent.log' | |
+ } | |
+ | |
+ log_openstack_service { 'neutron.server': | |
+ path => '/var/log/neutron/server.log' | |
+ } | |
+ | |
+ log_openstack_service { 'neutron.dhcp': | |
+ path => '/var/log/neutron/dhcp-agent.log' | |
+ } | |
+ | |
+ log_openstack_service { 'neutron.l3': | |
+ path => '/var/log/neutron/l3-agent.log' | |
+ } | |
+ | |
+ log_openstack_service { 'neutron.metadata': | |
+ path => '/var/log/neutron/metadata-agent.log' | |
+ } | |
+ | |
+ # keystone | |
+ log_openstack_service { 'keystone': | |
+ path => '/var/log/keystone/keystone.log' | |
+ } | |
+ | |
+ # Glance | |
+ log_openstack_service { 'glance.api': | |
+ path => '/var/log/glance/api.log' | |
+ } | |
+ | |
+ log_openstack_service { 'glance.registry': | |
+ path => '/var/log/glance/registry.log' | |
+ } | |
+ | |
+ # Cinder | |
+ log_openstack_service { 'cinder.api': | |
+ path => '/var/log/cinder/api.log' | |
+ } | |
+ | |
+ log_openstack_service { 'cinder.scheduler': | |
+ path => '/var/log/cinder/scheduler.log' | |
+ } | |
+ | |
+ log_openstack_service { 'cinder.volume': | |
+ path => '/var/log/cinder/volume.log' | |
+ } | |
+ | |
+ # TODO(sross): swift? | |
+ | |
+ fluentd::match { 'forward-to-aggregator': | |
+ pattern => 'greped.**', | |
+ priority => '51', | |
+ config => { | |
+ 'type' => 'forward', | |
+ 'heartbeat_type' => 'tcp', | |
+ 'servers' => [{ | |
+ 'name' => hiera("log_aggregation_server"), | |
+ 'host' => hiera("log_aggregation_server"), | |
+ 'port' => '4000' | |
+ }] | |
+ }, | |
+ notify => Class['fluentd::service'] | |
+ } | |
+ } | |
+ | |
} #END STEP 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/elements/overcloud-logging/README.md b/elements/overcloud-logging/README.md | |
new file mode 100644 | |
index 0000000..7cfa2c4 | |
--- /dev/null | |
+++ b/elements/overcloud-logging/README.md | |
@@ -0,0 +1 @@ | |
+Install all packages required for log aggregation on the overcloud | |
diff --git a/elements/overcloud-logging/element-deps b/elements/overcloud-logging/element-deps | |
new file mode 100644 | |
index 0000000..73015c2 | |
--- /dev/null | |
+++ b/elements/overcloud-logging/element-deps | |
@@ -0,0 +1,2 @@ | |
+package-installs | |
+pkg-map | |
diff --git a/elements/overcloud-logging/install.d/package-installs-overcloud-logging b/elements/overcloud-logging/install.d/package-installs-overcloud-logging | |
new file mode 100644 | |
index 0000000..3b8799b | |
--- /dev/null | |
+++ b/elements/overcloud-logging/install.d/package-installs-overcloud-logging | |
@@ -0,0 +1,2 @@ | |
+fluentd_package | |
+fluentd_add_plugin_package | |
diff --git a/elements/overcloud-logging/pkg-map b/elements/overcloud-logging/pkg-map | |
new file mode 100644 | |
index 0000000..2bef2d8 | |
--- /dev/null | |
+++ b/elements/overcloud-logging/pkg-map | |
@@ -0,0 +1,6 @@ | |
+{ | |
+ "default": { | |
+ "fluentd_package": "fluentd", | |
+ "fluentd_add_plugin_package": "rubygem-fluent-plugin-add" | |
+ } | |
+} | |
diff --git a/elements/puppet-modules/environment.d/01-puppet-modules-install-types.sh b/elements/puppet-modules/environment.d/01-puppet-modules-install-types.sh | |
index 514143c..d2eb84d 100644 | |
--- a/elements/puppet-modules/environment.d/01-puppet-modules-install-types.sh | |
+++ b/elements/puppet-modules/environment.d/01-puppet-modules-install-types.sh | |
@@ -48,7 +48,9 @@ if [ "$DIB_INSTALLTYPE_puppet_modules" = "source" ]; then | |
puppet-openstack_extras \ | |
puppet_aviator \ | |
puppetlabs-corosync \ | |
- puppet-tuskar; do | |
+ puppet-tuskar \ | |
+ puppet-fluentd \ | |
+ puppet-elasticsearch; do | |
export DIB_INSTALLTYPE_${name//\-/_}='source' | |
done | |
fi | |
diff --git a/elements/puppet-modules/source-repository-puppet-modules b/elements/puppet-modules/source-repository-puppet-modules | |
index fb10fa3..93a0c36 100644 | |
--- a/elements/puppet-modules/source-repository-puppet-modules | |
+++ b/elements/puppet-modules/source-repository-puppet-modules | |
@@ -46,4 +46,5 @@ puppetlabs-corosync git /opt/stack/puppet-modules/corosync https://github.com/pu | |
puppet_aviator git /opt/stack/puppet-modules/aviator https://github.com/aimonb/puppet_aviator.git | |
puppet-openstack_extras git /opt/stack/puppet-modules/openstack_extras https://github.com/stackforge/puppet-openstack_extras.git | |
puppet-tuskar git /opt/stack/puppet-modules/tuskar https://github.com/stackforge/puppet-tuskar.git | |
- | |
+puppet-fluentd git /opt/stack/puppet-modules/fluentd https://github.com/directxman12/puppet-fluentd.git | |
+puppet-elasticsearch git /opt/stack/puppet-modules/elasticsearch https://github.com/elastic/puppet-elasticsearch.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, there are a couple of manual steps that must be done -- you must manually add https://copr.fedoraproject.org/coprs/ggillies/openstack-operations/ to your repositories on the undercloud node and the overcloud image, and you need to manually install the elasticsearch package (but NOT configuration) on the undercloud (it's not currently in EPEL, so you can use the RPM provided by elastic.co).
Log aggregation can be enabled on the undercloud with
ENABLE_LOG_AGGREGATION=true
ininstack.answers
. For overcloud deployment, add a parameter to the deployment command (e.g.-P LogAggregationServer=192.0.2.1
) ofLogAggregationServer=LOCAL_IP
(whereLOCAL_IP
is the undercloud's IP, reachable by the overcloud nodes). Otherwise, theLogAggregationServer
parameter should be empty.