Authored by chunhua.zhang

Merge branch 'tiexin.yang' into 'master'

同步aws inventory hosts

## inventory
>aws spot实例发布后同步aws inventory hosts配置
## role
>新增redis-alone角色用于部署单节点(无tweproxy)的redis实例
>修改redis集群角色的readme说明文件


See merge request !4
# inventory file for az2
# auto generated at 2018-12-28 07:41:28
# auto generated at 2019-01-02 06:39:19
[nameservers]
172.31.9.217
... ... @@ -19,50 +19,70 @@
[java-activity]
172.31.70.6
172.31.70.82
[java-bigdata]
172.31.70.6
172.31.70.82
[java-brower]
172.31.70.36
172.31.70.46
[java-erpgateway]
172.31.70.36
172.31.70.46
[java-gateway]
172.31.70.77
172.31.70.113
172.31.70.8
172.31.70.104
[java-message]
172.31.70.114
172.31.70.59
[java-order]
172.31.70.116
172.31.70.124
172.31.70.43
[java-platform-cms]
172.31.70.42
[java-product]
172.31.70.114
172.31.70.59
[java-promotion]
172.31.70.116
172.31.70.124
172.31.70.43
[java-resources]
172.31.70.75
172.31.70.99
[java-risk]
172.31.70.6
172.31.70.82
[java-sns]
172.31.70.114
172.31.70.59
[java-ufo-fore]
... ... @@ -75,18 +95,22 @@
[java-uic]
172.31.70.36
172.31.70.46
[java-union]
172.31.70.69
172.31.70.44
[java-users]
172.31.70.75
172.31.70.99
[java-wechat]
172.31.70.36
172.31.70.46
[search-service]
... ...
Redis
=========
- 安装Redis server(不持久化), 并使用twemproxy支持Redis高可用集群
- Redis 默认端口: 6379
- twemproxy 默认端口: 22121
Author Information
------------------
tiexin.yang@yoho.cn
... ...
No preview for this file type
---
# handlers file for redis
- name: stop redis
shell: /Data/local/redis/bin/redis-cli -h "{{ ansible_default_ipv4['address'] }}" -p 6379 shutdown
ignore_errors: True
- name: start redis
shell: /Data/local/redis/bin/redis-server /Data/local/redis/conf/redis.conf
... ...
galaxy_info:
author: tiexin.yang@yoho.cn
description: install redis with twemproxy supported HA available
company: yohobuy.com
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
... ...
---
# tasks file for redis-cluster
# install redis server
- name: Ensure libselinux-python is installed
yum:
name: libselinux-python
state: installed
update_cache: yes
- name: Check if redis already installed
stat: path=/Data/local/redis/bin/redis-server
register: redis_binary
- name: Upload redis source package
copy:
src: "redis-3.2.12.tar.gz"
dest: "/root/redis-3.2.12.tar.gz"
mode: 0755
when: redis_binary.stat.exists == False
- name: Make sure autoconf268 utils installed
yum:
name: autoconf268,automake,libtool,gcc
state: installed
update_cache: yes
when: not dc == "aws"
- name: Make sure autoconf utils installed
yum:
name: autoconf,automake,libtool,gcc
state: installed
update_cache: yes
when: dc == "aws"
- name: Decompress and install redis
shell: cd /root/ && mkdir -p /Data/local/ && tar -zxvf redis-3.2.12.tar.gz && cd redis-3.2.12 && make MALLOC=libc && make PREFIX=/Data/local/redis install && mkdir -p /Data/local/redis/conf /Data/logs/redis/ /Data/local/redis/data
when: redis_binary.stat.exists == False
- name: Update redis configuration file
template:
src: "redis.conf.j2"
dest: "/Data/local/redis/conf/redis.conf"
notify:
- stop redis
- start redis
- name: set autoconf binary file
set_fact:
autoreconf: 'autoconf'
when: dc == "aws"
- name: set autoconfa68 binary file
set_fact:
autoreconf: 'autoconf268 -ivf'
when: not dc == "aws"
... ...
redis.conf
=========
- 基本路径:/Data/local/redis/
- 禁用redis持久化配置
- 监听端口6379
- 最大可使用内存(maxmemory)默认为系统物理内存的80%
Author Information
------------------
tiexin.yang@yoho.cn
... ...
daemonize yes
pidfile /Data/local/redis/redis.pid
bind "{{ ansible_default_ipv4['address'] }}"
port 6379
tcp-backlog 511
timeout 300
tcp-keepalive 60
loglevel notice
logfile "/Data/logs/redis/redis.log"
databases 16
save ""
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename redis01.rdb
dir /Data/local/redis/data
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100
maxclients 2048
maxmemory {{ ansible_memtotal_mb*0.8 }}M
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
requirepass redis9646
... ...
... ... @@ -3,13 +3,13 @@ redis.conf
- 基本路径:/Data/local/redis/
- 禁用redis持久化配置
- 监听端口6379
- 监听端口16379
- 最大可使用内存(maxmemory)默认为系统物理内存的80%
nutcracker.yml
=========
- redis集群默认监听端口: 22121
- redis集群默认监听端口: 6379
Author Information
------------------
... ...