国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

Mysql|Sql Server|Oracle|Redis|MongoDB|PostgreSQL|Sqlite|DB2|mariadb|Access|數(shù)據(jù)庫(kù)技術(shù)|

服務(wù)器之家 - 數(shù)據(jù)庫(kù) - Redis - Centos7 Redis主從搭建配置的實(shí)現(xiàn)

Centos7 Redis主從搭建配置的實(shí)現(xiàn)

2019-11-15 16:18Lancger Redis

這篇文章主要介紹了Centos7 Redis主從搭建配置的實(shí)現(xiàn),小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

一、環(huán)境介紹

Redis—master   172.18.8.19
Redis—slave   172.18.8.20

二、redis主的配置

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#創(chuàng)建redis數(shù)據(jù)目錄
mkdir -p /data0/redis_trade
 
#redis主配置文件
root># cat redis_6379.conf |grep -Ev "^$|^#"
bind 172.18.8.19
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile "/var/log/redis_6379.log"
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump_6379.rdb
dir /data0/redis_trade
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
requirepass Allwelltokok
appendonly yes
appendfilename "appendonly_6379.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-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
rename-command FLUSHALL ZYzv6FOBdwflW2nX
rename-command EVAL S9UHPKEpSvUJMM
rename-command FLUSHDB D60FPVDJuip7gy6l
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

三、redis從配置

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
root># cat redis_6379.conf |grep -Ev "^$|^#"
bind 172.18.8.20
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile "/var/log/redis_6379.log"
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump_6379.rdb
dir /data0/redis_trade
slaveof 172.18.8.19 6379   -----從庫(kù)比主庫(kù)多這2行配置參數(shù)
masterauth Allwelltokok   -----從庫(kù)比主庫(kù)多這2行配置參數(shù)
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
requirepass Allwelltokok
appendonly yes
appendfilename "appendonly_6379.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-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
rename-command FLUSHALL ZYzv6FOBdwflW2nX
rename-command EVAL S9UHPKEpSvUJMM
rename-command FLUSHDB D60FPVDJuip7gy6l
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

四、redis啟動(dòng)腳本

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
root># cat /etc/init.d/redis_6379
#!/bin/sh
#
# Simple Redis init.d script conceived to work on Linux systems
# as it does use of the /proc filesystem.
# chkconfig:  2345 90 10
 
source /etc/init.d/functions
REDISPORT=6379
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli
 
PIDFILE=/var/run/redis_${REDISPORT}.pid
CONF="/usr/local/redis/etc/redis_${REDISPORT}.conf"
AUTH="Allwelltokok"
BIND_IP='172.18.8.19'
 
start(){
   
  if [ -f $PIDFILE ]
  then
    echo "$PIDFILE exists, process is already running or crashed"
  else
    echo "Starting Redis server..."
    $EXEC $CONF
  fi
  if [ "$?"="0" ]
  then
    echo "Redis is running..."
  fi
 
 
}
 
stop(){
 
  if [ ! -f $PIDFILE ]
  then
    echo "$PIDFILE does not exist, process is not running"
  else
    PID=$(cat $PIDFILE)
    echo "Stopping ..."
    $CLIEXEC -h $BIND_IP -a $AUTH -p $REDISPORT SHUTDOWN
    sleep 1
    while [ -x /proc/${PID} ]
    do
      echo "Waiting for Redis to shutdown ..."
      sleep 1
    done
      echo "Redis stopped"
  fi
}
 
restart(){
  stop
  start
 
}
status(){
 
  ps -ef|grep redis-server|grep -v grep >/dev/null 2>&1
 
  if [ $? -eq 0 ];then
 
    echo "redis server is running"
 
  else
    echo "redis server is stopped"
 
  fi
   
 
}
 
 
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
     
  restart)
    restart
    ;;
     
  status)
    status
    ;;  
  *)
   
   echo "Usage: /etc/init.d/redis {start|stop|status|start}" >&2
   exit 1
esac

五、啟動(dòng)服務(wù)

?
1
root># /etc/init.d/redis_6379 start 

查看日志

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
root># tail -100f /var/log/redis_6379.log
5563:S 29 Jun 22:14:23.236 * Increased maximum number of open files to 10032 (it was originally set to 1024).
        _._                        
      _.-``__ ''-._                      
   _.-``  `. `_. ''-._      Redis 3.2.12 (00000000/0) 64 bit
 .-`` .-```. ```\/  _.,_ ''-._                 
 '   ,    .-` | `,  )   Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|   Port: 6379
 |  `-._  `._  /   _.-'  |   PID: 5563
 `-._  `-._ `-./ _.-'  _.-'                 
 |`-._`-._  `-.__.-'  _.-'_.-'|                
 |  `-._`-._    _.-'_.-'  |      http://redis.io   
 `-._  `-._`-.__.-'_.-'  _.-'                 
 |`-._`-._  `-.__.-'  _.-'_.-'|                
 |  `-._`-._    _.-'_.-'  |                
 `-._  `-._`-.__.-'_.-'  _.-'                 
   `-._  `-.__.-'  _.-'                   
     `-._    _.-'                     
       `-.__.-'                       
 
5563:S 29 Jun 22:14:23.237 # Server started, Redis version 3.2.12
5563:S 29 Jun 22:14:23.237 * The server is now ready to accept connections on port 6379
5563:S 29 Jun 22:14:23.237 * Connecting to MASTER 172.18.8.19:6379
5563:S 29 Jun 22:14:23.237 * MASTER <-> SLAVE sync started
5563:S 29 Jun 22:14:23.237 * Non blocking connect for SYNC fired the event.
5563:S 29 Jun 22:14:23.238 * Master replied to PING, replication can continue...
5563:S 29 Jun 22:14:23.238 * Partial resynchronization not possible (no cached master)
5563:S 29 Jun 22:14:23.239 * Full resync from master: c9f303069f87253011bf39369366732a2e88b389:1
5563:S 29 Jun 22:14:23.304 * MASTER <-> SLAVE sync: receiving 77 bytes from master
5563:S 29 Jun 22:14:23.305 * MASTER <-> SLAVE sync: Flushing old data
5563:S 29 Jun 22:14:23.305 * MASTER <-> SLAVE sync: Loading DB in memory
5563:S 29 Jun 22:14:23.305 * MASTER <-> SLAVE sync: Finished with success
5563:S 29 Jun 22:14:23.305 * Background append only file rewriting started by pid 5567
5563:S 29 Jun 22:14:23.329 * AOF rewrite child asks to stop sending diffs.
5567:C 29 Jun 22:14:23.329 * Parent agreed to stop sending diffs. Finalizing AOF...
5567:C 29 Jun 22:14:23.329 * Concatenating 0.00 MB of AOF diff received from parent.
5567:C 29 Jun 22:14:23.329 * SYNC append only file rewrite performed
5567:C 29 Jun 22:14:23.330 * AOF rewrite: 0 MB of memory used by copy-on-write
5563:S 29 Jun 22:14:23.337 * Background AOF rewrite terminated with success
5563:S 29 Jun 22:14:23.337 * Residual parent diff successfully flushed to the rewritten AOF (0.00 MB)
5563:S 29 Jun 22:14:23.337 * Background AOF rewrite finished successfully 

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。

原文鏈接:https://segmentfault.com/a/1190000015432869

延伸 · 閱讀

精彩推薦
  • RedisRedis的配置、啟動(dòng)、操作和關(guān)閉方法

    Redis的配置、啟動(dòng)、操作和關(guān)閉方法

    今天小編就為大家分享一篇Redis的配置、啟動(dòng)、操作和關(guān)閉方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧 ...

    大道化簡(jiǎn)5312019-11-14
  • RedisRedis 事務(wù)知識(shí)點(diǎn)相關(guān)總結(jié)

    Redis 事務(wù)知識(shí)點(diǎn)相關(guān)總結(jié)

    這篇文章主要介紹了Redis 事務(wù)相關(guān)總結(jié),幫助大家更好的理解和學(xué)習(xí)使用Redis,感興趣的朋友可以了解下...

    AsiaYe8232021-07-28
  • Redisredis實(shí)現(xiàn)排行榜功能

    redis實(shí)現(xiàn)排行榜功能

    排行榜在很多地方都能使用到,redis的zset可以很方便地用來(lái)實(shí)現(xiàn)排行榜功能,本文就來(lái)簡(jiǎn)單的介紹一下如何使用,具有一定的參考價(jià)值,感興趣的小伙伴們...

    乘月歸5022021-08-05
  • Redis詳解Redis復(fù)制原理

    詳解Redis復(fù)制原理

    與大多數(shù)db一樣,Redis也提供了復(fù)制機(jī)制,以滿足故障恢復(fù)和負(fù)載均衡等需求。復(fù)制也是Redis高可用的基礎(chǔ),哨兵和集群都是建立在復(fù)制基礎(chǔ)上實(shí)現(xiàn)高可用的...

    李留廣10222021-08-09
  • RedisRedis全量復(fù)制與部分復(fù)制示例詳解

    Redis全量復(fù)制與部分復(fù)制示例詳解

    這篇文章主要給大家介紹了關(guān)于Redis全量復(fù)制與部分復(fù)制的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用Redis爬蟲(chóng)具有一定的參考學(xué)習(xí)...

    豆子先生5052019-11-27
  • RedisRedis如何實(shí)現(xiàn)數(shù)據(jù)庫(kù)讀寫分離詳解

    Redis如何實(shí)現(xiàn)數(shù)據(jù)庫(kù)讀寫分離詳解

    Redis的主從架構(gòu),能幫助我們實(shí)現(xiàn)讀多,寫少的情況,下面這篇文章主要給大家介紹了關(guān)于Redis如何實(shí)現(xiàn)數(shù)據(jù)庫(kù)讀寫分離的相關(guān)資料,文中通過(guò)示例代碼介紹...

    羅兵漂流記6092019-11-11
  • Redisredis中如何使用lua腳本讓你的靈活性提高5個(gè)逼格詳解

    redis中如何使用lua腳本讓你的靈活性提高5個(gè)逼格詳解

    這篇文章主要給大家介紹了關(guān)于redis中如何使用lua腳本讓你的靈活性提高5個(gè)逼格的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具...

    一線碼農(nóng)5812019-11-18
  • Redisredis 交集、并集、差集的具體使用

    redis 交集、并集、差集的具體使用

    這篇文章主要介紹了redis 交集、并集、差集的具體使用,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友...

    xiaojin21cen10152021-07-27
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 久久人人av | av在线干 | 日韩在线看片 | 国产精品女同一区二区久久夜 | 国产成人午夜精品5599 | 中文字幕亚洲精品 | 国产超碰人人爽人人做人人爱 | 日本精品在线观看 | 亚洲精品在线免费看 | 国产一区二区三区免费视频 | 国产精品免费精品自在线观看 | 国产精品123 | 一性一交一色生活片 | 亚洲视频在线观看 | 91视视频在线观看入口直接观看 | 日韩欧美视频免费在线观看 | 自拍视频在线观看 | 婷婷综合久久 | 日韩精品极品视频在线观看免费 | 999国产在线观看 | 日韩综合网 | 国产日韩欧美在线观看 | 亚洲精品久久久久久国 | 国产一级黄色大片 | 免费一看一级毛片 | 国产精品一区二区不卡 | 久久亚洲国产 | 成人美女av| 色精品 | 欧美精产国品一二三区 | 人人插 | 一区二区中文 | 亚洲国产成人av好男人在线观看 | 欧美福利在线 | 国内成人自拍视频 | 天天操天天插 | 亚洲国产欧美日韩 | 毛片一卡| 亚洲一区二区三区在线 | 久久国产视频精品 | 在线视频成人 |