snake_l 发表于 2018-1-3 17:47:21

SaltStack安装Redis-第十篇

# salt 'linux-node2*' state.sls redis-cluster.redis-mastersaltenv=prod  
linux
-node2.example.com:  

----------  
ID: redis
-install  
Function: pkg.installed
  
Name: redis
  
Result: True
  
Comment: The following packages were installed
/updated: redis  
Started:
22:48:16.616612  
Duration:
15732.74 ms  
Changes:
  

----------  
jemalloc:
  

----------  
new:
  

3.6.0-1.el7  
old:
  
redis:
  

----------  
new:
  

3.2.10-2.el7  
old:
  

----------  
ID: redis
-master-config  
Function:
file.managed  
Name:
/etc/redis.conf  
Result: True
  
Comment: File
/etc/redis.conf updated  
Started:
22:48:32.351877  
Duration:
45.19 ms  
Changes:
  

----------  
diff:
  
---
  
+++
  
@@ -44,7 +44,7 @@
  
#
  
# Examples:
  
#
  
-# bind 192.168.1.100 10.0.0.1
  
+#bind 0.0.0.0
  
# bind 127.0.0.1 ::1
  
#
  
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
  
@@ -58,7 +58,7 @@
  
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
  
# JUST COMMENT THE FOLLOWING LINE.
  
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
-bind 127.0.0.1
  
+bind 0.0.0.0
  

  
# Protected mode is a layer of security protection, in order to avoid that
  
# Redis instances left open on the internet are accessed and exploited.
  
@@ -125,7 +125,7 @@
  

  
# By default Redis does not run as a daemon. Use 'yes' if you need it.
  
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
  
-daemonize no
  
+daemonize yes
  

  
# If you run Redis from upstart or systemd, Redis can interact with your
  
# supervision tree. Options:
  
@@ -534,7 +534,7 @@
  
# limit for maxmemory so that there is some free RAM on the system for slave
  
# output buffers (but this is not needed if the policy is 'noeviction').
  
#
  
-# maxmemory <bytes>
  
+maxmemory 1G
  

  
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
  
# is reached. You can select among five behaviors:
  
mode:
  
0644
  
user:
  
root
  
----------
  
ID: redis-master-service
  
Function: service.running
  
Name: redis
  
Result: True
  
Comment: Service redis has been enabled, and is running
  
Started: 22:48:32.412154
  
Duration: 453.972 ms
  
Changes:
  
----------
  
redis:
  
True
  

  
Summary
  
------------
  
Succeeded: 3 (changed=3)
  
Failed:    0
  
------------
  
Total states run:   3
页: [1]
查看完整版本: SaltStack安装Redis-第十篇