systemd_redis.j2 1.1 KB

12345678910111213141516171819202122
  1. #####################################################################
  2. # {{ ansible_managed }}
  3. # {{ item['port'] }}
  4. #####################################################################
  5. [Unit]
  6. Description=Redis Server Port {{ item['port'] }}
  7. After=network.target
  8. [Service]
  9. WorkingDirectory=/redis/persistant/cpredis
  10. Type=simple
  11. LimitNOFILE=65535
  12. User=redis
  13. ExecStart=/usr/bin/taskset -c 2-{{ ansible_processor_nproc }} /usr/local/bin/redis-server --save "" --appendonly no --port {{ item['port'] }} --protected-mode no --dbfilename {{ item['port'] }}-redis.rdb --loadmodule /home/redis/redisraft/redisraft.so addr={{ ansible_default_ipv4.address }}:{{ item['port'] }} raft-log-fsync=no follower-proxy=no raftize-all-commands=yes cluster-start-hslot={{ item['start-hslot'] }} cluster-end-hslot={{ item['end-hslot'] }} raft-log-filename={{ item['port'] }}-raftlog.db cluster-mode=yes
  14. StandardOutput=file:/var/log/cpredis/redis-{{ item['port'] }}.log
  15. StandardError=file:/var/log/cpredis/redis-{{ item['port'] }}-error.log
  16. [Install]
  17. WantedBy=multi-user.target
  18. Alias=redis-{{ item['port'] }}.service