zoukankan      html  css  js  c++  java
  • linux安装redis脚本

    #!/bin/bash
    #单机redis
    datedir="/home/public"
    mkdir -p $datedir/redis/bin &&cd $datedir/redis
    wget http://download.redis.io/releases/redis-3.2.11.tar.gz
    tar xzf redis-3.2.11.tar.gz
    cd redis-3.2.11
    make
    cp src/redis-server src/redis-cli $datedir/redis/bin
    chmod -R a+x $datedir/redis/bin/*
    PATH=$PATH:$datedir/redis/bin
    export $PATH
    cat >$datedir/redis/redis.conf<<eof
    #bind 10.10.11.171
    protected-mode no
    port 6379
    tcp-backlog 511
    timeout 0
    tcp-keepalive 300
    daemonize yes
    supervised no
    pidfile $datedir/redis/redis.pid
    loglevel notice
    logfile "$datedir/redis/redis.log"
    databases 16
    save 900 1
    save 300 10
    save 60 10000
    stop-writes-on-bgsave-error yes
    rdbcompression yes
    rdbchecksum yes
    dbfilename dump.rdb
    dir $datedir/redis/
    masterauth qwert12345
    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 yk-2018.com
    appendonly yes
    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
    cluster-enabled no
    cluster-config-file nodes.conf
    cluster-node-timeout 15000
    cluster-require-full-coverage no
    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
    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
    eof
    #启动
    nohup redis-server $datedir/redis/redis.conf &
    
    
  • 相关阅读:
    nginx能访问html静态文件但无法访问php文件
    LeetCode "498. Diagonal Traverse"
    LeetCode "Teemo Attacking"
    LeetCode "501. Find Mode in Binary Search Tree"
    LeetCode "483. Smallest Good Base" !!
    LeetCode "467. Unique Substrings in Wraparound String" !!
    LeetCode "437. Path Sum III"
    LeetCode "454. 4Sum II"
    LeetCode "445. Add Two Numbers II"
    LeetCode "486. Predict the Winner" !!
  • 原文地址:https://www.cnblogs.com/liuliu3/p/9844571.html
Copyright © 2011-2022 走看看