标签:and main init man deb use dock soft when
redis - hosts: docker
remote_user: root
vars:
epic: true
redis_dir: /usr/local/redis
datesoft: /data/sh
roles:
- redis
root@centos-mysql01:/data/sh/ansible_role# cat redis/tasks/main.yml
root@centos-mysql01:/data/sh/ansible_role# ls redis/files/
redis6379.conf Redis-server-init redis-server.service
redis_install_dir="/usr/local/redis"
sed -i ‘s@pidfile.@pidfile /var/run/redis/redis.pid@‘ ${redis_install_dir}/etc/redis.conf
sed -i "s@logfile.@logfile ${redis_install_dir}/var/redis.log@" ${redis_install_dir}/etc/redis.conf
sed -i "s@^dir.*@dir ${redis_install_dir}/var@" ${redis_install_dir}/etc/redis.conf
sed -i ‘s@daemonize no@daemonize yes@‘ ${redis_install_dir}/etc/redis.conf
sed -i "s@^# bind 127.0.0.1@bind 127.0.0.1@" ${redis_install_dir}/etc/redis.conf
Mem=free -m|awk -F: ‘{print $2}‘|awk ‘{print $1}‘|head -n2|tail -n 1
redis_maxmemory=expr $Mem / 8
000000
sed -i "s@maxmemory <bytes>@maxmemory <bytes>\nmaxmemory expr $Mem / 8
000000@" ${redis_install_dir}/etc/redis.conf
链接: https://pan.baidu.com/s/1Mvg1oaoLKojtBP6BjgBCvg 提取码: rf29
标签:and main init man deb use dock soft when
原文地址:http://blog.51cto.com/9025736/2332051