Fix memcached logging
Even though we're setting memcached::logfile: '/var/log/memcached/memcached.log' there are no logs created in /var/log/containers/memcached. The reason for this is that memcached::logfile in puppet-memcached simply adds a shell redirect to a file. These redirecs are passed by tht and kolla to the memcached process invocation as parameters of memcached and so are not read being read by the shell process and nothing gets redirected. That is why we observe that on a broken container the redirections are arguments to memcached: [root@controller-0 ~]# ps aux | grep memcache | grep -v containers 42457 358189 0.0 0.0 744088 10960 ? Sl 15:21 0:00 /usr/bin/memcached -p 11211 -u memcached -m 16000 -c 8192 -vv -l 172.17.1.138 -U 0 -X -t 8 >> /var/log/memcached/memcached.log 2>&1 Fix this by forcing memcached to log on stdout and at the same time creating the redirect on the shell parameters that invoke memcached. Tested on a Train environment and I correctly get: 1) Proper logging [root@controller-0 ~]# ls -l /var/log/containers/memcached/memcached.log -rw-r--r--. 1 42457 42457 29086 Nov 4 18:00 /var/log/containers/memcached/memcached.log 2) No unused redirections inside the memcached process: [root@controller-0 ~]# podman exec -it -uroot memcached ps -ef UID PID PPID C STIME TTY TIME CMD memcach+ 1 0 0 18:47 ? 00:00:00 dumb-init --single-child -- kolla_start memcach+ 6 1 0 18:47 ? 00:00:00 /usr/bin/memcached -p 11211 -u memcached -m 9953 -c 8192 -vv -l 172.17.1.50 -U 0 -X -t 4 Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com> Resolves: #1902922 NB: Slight conflict when cherry-picking due to different context Change-Id: If5487c9be745ebd6bc3ebe172e28dc59e6855188 (cherry picked from commita9da212d7d
) (cherry picked from commitd7d9e05ff8
) (cherry picked from commit29b8a69a89
)
This commit is contained in:
parent
1309c809a1
commit
ef2ebb18d1
|
@ -138,7 +138,7 @@ outputs:
|
||||||
dport: 11211
|
dport: 11211
|
||||||
proto: 'tcp'
|
proto: 'tcp'
|
||||||
source: {get_param: MemcachedIpSubnet}
|
source: {get_param: MemcachedIpSubnet}
|
||||||
memcached::logfile: '/var/log/memcached/memcached.log'
|
memcached::logstdout: true
|
||||||
service_config_settings:
|
service_config_settings:
|
||||||
collectd:
|
collectd:
|
||||||
tripleo.collectd.plugins.memcached:
|
tripleo.collectd.plugins.memcached:
|
||||||
|
@ -156,7 +156,7 @@ outputs:
|
||||||
config_image: {get_param: ContainerMemcachedConfigImage}
|
config_image: {get_param: ContainerMemcachedConfigImage}
|
||||||
kolla_config:
|
kolla_config:
|
||||||
/var/lib/kolla/config_files/memcached.json:
|
/var/lib/kolla/config_files/memcached.json:
|
||||||
command: bash -c $* -- eval source /etc/sysconfig/memcached; exec /usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS
|
command: bash -c $* -- eval source /etc/sysconfig/memcached; exec /usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS >> /var/log/memcached/memcached.log 2>&1
|
||||||
config_files:
|
config_files:
|
||||||
- source: "/var/lib/kolla/config_files/src/*"
|
- source: "/var/lib/kolla/config_files/src/*"
|
||||||
dest: "/"
|
dest: "/"
|
||||||
|
|
Loading…
Reference in New Issue