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 &
    
    
  • 相关阅读:
    Reactor系列(四)subscribe订阅
    Reactor系列(三)创建Flux,Mono(续)
    Reactor系列(二)Flux Mono创建
    Reactor系列(一)基本概念
    Stream系列(十五)File方法使用
    Stream系列(十四)parallet方法使用
    OpenCV二值化、归一化操作
    C# 队列
    linux shell脚本程序路径作为变量
    C++中头文件(.h)和源文件(.cpp)都应该写些什么
  • 原文地址:https://www.cnblogs.com/liuliu3/p/9844571.html
Copyright © 2011-2022 走看看