Chinaunix首页 | 论坛 | 博客
  • 博客访问: 127889
  • 博文数量: 10
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 172
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-22 16:29
个人简介

坚持专注,追求卓越。

文章分类

全部博文(10)

文章存档

2015年(3)

2014年(3)

2013年(4)

我的朋友

分类: LINUX

2013-07-22 18:17:59

安装及配置脚本:

点击(此处)折叠或打开

  1. #!/bin/bash
  2. #
  3. if [[ $1 == "" ]];then
  4. echo "Usage: $0 ipaddr***"
  5. exit 0
  6. fi
  7. masterIp=$1
  8. cd /usr/local/src/
  9. tar -zxvf redis-2.6.12.tar.gz
  10. cd /usr/local/src/redis-2.6.12
  11. make && make install
  12. mkdir -p /etc/redis/
  13. mkdir -p /export/data/redis_data/6379
  14. mkdir -p /export/data/redis_data/6380
  15. sed -i "s/127.0.0.1/$masterIp/g" /usr/local/src/6380.conf
  16. cp -rf /usr/local/src/6379.conf /etc/redis/
  17. cp -rf /usr/local/src/6380.conf /etc/redis/
  18. cat >> /etc/sysctl.conf <
  19. net.core.somaxconn = 32768
  20. net.core.wmem_default = 8388608
  21. net.core.rmem_default = 8388608
  22. net.core.rmem_max = 16777216
  23. net.core.wmem_max = 16777216
  24. net.ipv4.tcp_timestamps = 0
  25. net.ipv4.tcp_synack_retries = 1
  26. net.ipv4.tcp_syn_retries = 0
  27. net.ipv4.tcp_tw_recycle = 1
  28. net.ipv4.tcp_tw_reuse = 1
  29. net.ipv4.tcp_mem = 94500000 915000000 927000000
  30. net.ipv4.tcp_max_orphans = 3276800
  31. net.ipv4.ip_local_port_range = 1024 65535
  32. net.ipv4.tcp_fin_timeout = 10
  33. net.ipv4.tcp_keepalive_time = 100
  34. net.ipv4.tcp_syncookies = 1
  35. net.ipv4.tcp_max_syn_backlog = 8192
  36. net.ipv4.tcp_max_tw_buckets = 20000
  37. EOF
  38. modprobe bridge
  39. sysctl -p
  40. /usr/local/bin/redis-server /etc/redis/6379.conf
  41. /usr/local/bin/redis-server /etc/redis/6380.conf

6379.sh
 

点击(此处)折叠或打开

  1. daemonize yes
  2. pidfile /var/run/redis_6379.pid
  3. port 6379
  4. timeout 300
  5. tcp-keepalive 0
  6. loglevel notice
  7. #logfile stdout
  8. databases 16
  9. unixsocketperm 0
  10. maxmemory 2000000000
  11. maxmemory-policy volatile-lru
  12. maxmemory-samples 3
  13. maxclients 10000
  14. #save 900 1
  15. #save 300 10
  16. #save 60 10000
  17. stop-writes-on-bgsave-error yes
  18. rdbcompression yes
  19. rdbchecksum yes
  20. dbfilename dump.rdb
  21. dir /export/data/redis_data/6379
  22. slave-serve-stale-data yes
  23. slave-read-only yes
  24. repl-ping-slave-period 10
  25. repl-timeout 60
  26. repl-disable-tcp-nodelay no
  27. slave-priority 100
  28. appendonly no
  29. appendfsync everysec
  30. no-appendfsync-on-rewrite no
  31. auto-aof-rewrite-percentage 100
  32. auto-aof-rewrite-min-size 64mb
  33. lua-time-limit 5000
  34. slowlog-log-slower-than 10000
  35. slowlog-max-len 1024
  36. hash-max-ziplist-entries 512
  37. hash-max-ziplist-value 64
  38. list-max-ziplist-entries 512
  39. list-max-ziplist-value 64
  40. set-max-intset-entries 512
  41. zset-max-ziplist-entries 128
  42. zset-max-ziplist-value 64
  43. activerehashing yes
  44. client-output-buffer-limit normal 0 0 0
  45. client-output-buffer-limit slave 256mb 64mb 60
  46. client-output-buffer-limit pubsub 32mb 8mb 60
  47. hz 10
6380.sh



点击(此处)折叠或打开

  1. daemonize yes
  2. pidfile /var/run/redis_6380.pid
  3. port 6380
  4. timeout 300
  5. tcp-keepalive 0
  6. loglevel notice
  7. #logfile stdout
  8. databases 16
  9. unixsocketperm 0
  10. maxmemory 2000000000
  11. maxmemory-policy volatile-lru
  12. maxmemory-samples 3
  13. maxclients 10000
  14. #save 900 1
  15. #save 300 10
  16. #save 60 10000
  17. stop-writes-on-bgsave-error yes
  18. rdbcompression yes
  19. rdbchecksum yes
  20. dbfilename dump.rdb
  21. dir /export/data/redis_data/6380
  22. slaveof 127.0.0.1 6379
  23. slave-serve-stale-data yes
  24. slave-read-only yes
  25. repl-ping-slave-period 10
  26. repl-timeout 60
  27. repl-disable-tcp-nodelay no
  28. slave-priority 100
  29. appendonly yes
  30. appendfsync everysec
  31. no-appendfsync-on-rewrite no
  32. auto-aof-rewrite-percentage 100
  33. auto-aof-rewrite-min-size 64mb
  34. lua-time-limit 5000
  35. slowlog-log-slower-than 10000
  36. slowlog-max-len 1024
  37. hash-max-ziplist-entries 512
  38. hash-max-ziplist-value 64
  39. list-max-ziplist-entries 512
  40. list-max-ziplist-value 64
  41. set-max-intset-entries 512
  42. zset-max-ziplist-entries 128
  43. zset-max-ziplist-value 64
  44. activerehashing yes
  45. client-output-buffer-limit normal 0 0 0
  46. client-output-buffer-limit slave 256mb 64mb 60
  47. client-output-buffer-limit pubsub 32mb 8mb 60
  48. hz 10


阅读(2473) | 评论(2) | 转发(1) |
1

上一篇:没有了

下一篇:linux开启swap(磁盘缓存)操作

给主人留下些什么吧!~~

rubydrew2013-07-23 09:50:12

写错了一个IP,已更改。

校长的马夹2013-07-23 08:57:26

.  期待更多文章