voxpupuli / puppet-redis

Puppet Module to manage Redis
https://forge.puppet.com/puppet/redis
Apache License 2.0
40 stars 183 forks source link

Rediscluster on Ubuntu 20.04 #402

Closed kaiszy closed 2 years ago

kaiszy commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

I have configured a rediscluster with the following configurtation:

  class { '::redis':
    default_install => false,
    service_enable  => false,
    service_ensure  => 'stopped',
    manage_repo => true,
    minimum_version => '6.0.6',
  }

  redis::instance { "redis_primary_on_port_${primary_port}":
    service_enable       => true,
    service_ensure       => 'running',
    masterauth           => $rediscluser_password,
    requirepass          => $rediscluser_password,
    daemonize            => true,
    port                 => $primary_port,
    bind                 => $::ipaddress,
    appendonly           => true,
    log_level            => 'debug',
    cluster_enabled      => true,
    cluster_config_file  => 'nodes-primary.conf',
    cluster_node_timeout => 5000,
    managed_by_cluster_manager => true,
    require              => Class['Redis'],
  }

What are you seeing

Then puppet agent run installs redis and add a systemd Servicefile. But when i try to start redis i get:

#systemctl start redis-server-redis_primary_on_port_7122.service
Job for redis-server-redis_primary_on_port_7122.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status redis-server-redis_primary_on_port_7122.service" and "journalctl -xe" for details.
421344:C 12 May 2021 14:00:00.360 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=421344, just started
421344:C 12 May 2021 14:00:00.360 # Configuration loaded
421344:C 12 May 2021 14:00:00.360 # WARNING supervised by systemd - you MUST set appropriate values for TimeoutStartSec and TimeoutStopSec in your service unit.
421345:signal-handler (1620820800) Received SIGTERM scheduling shutdown...
421345:M 12 May 2021 14:00:00.363 * Node configuration loaded, I'm a98cf4509173b34f2b8ef772b3403ba5ffcf6499
421345:M 12 May 2021 14:00:00.363 * Running mode=cluster, port=7122.
421345:M 12 May 2021 14:00:00.363 # Server initialized
421345:M 12 May 2021 14:00:00.363 * Reading RDB preamble from AOF file...
421345:M 12 May 2021 14:00:00.363 * Loading RDB produced by version 6.0.6
421345:M 12 May 2021 14:00:00.363 * RDB age 70 seconds
421345:M 12 May 2021 14:00:00.363 * RDB memory usage when created 2.70 Mb
421345:M 12 May 2021 14:00:00.363 * RDB has an AOF tail
421345:M 12 May 2021 14:00:00.364 * Reading the remaining AOF tail...
421345:M 12 May 2021 14:00:00.364 * DB loaded from append only file: 0.001 seconds
421345:M 12 May 2021 14:00:00.364 * Ready to accept connections
421345:M 12 May 2021 14:00:00.364 * The server is now ready to accept connections at /var/run/redis/redis-server-redis_primary_on_port_7122.sock
421345:M 12 May 2021 14:00:00.364 # User requested shutdown...
421345:M 12 May 2021 14:00:00.364 * Calling fsync() on the AOF file.
421345:M 12 May 2021 14:00:00.364 * Saving the final RDB snapshot before exiting.
421345:M 12 May 2021 14:00:00.366 * DB saved on disk
421345:M 12 May 2021 14:00:00.366 * Removing the pid file.
421345:M 12 May 2021 14:00:00.366 * Removing the unix socket file.
421345:M 12 May 2021 14:00:00.366 # Redis is now ready to exit, bye bye...

and immediate stops.

What behaviour did you expect instead

That there is a redis instance with the above setting running.

Output log

See above.

Any additional information you'd like to impart

When i start the redisinstance by hand:

mkdir /var/run/redis && /usr/bin/redis-server /etc/redis/redis-server-redis_primary_on_port_7122.conf --supervised systemd

without systemctl it works. So i think the puppet module generated system-servicefile is the problem.