真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

redis安裝配置參考

1.操作系統(tǒng)參數(shù)和服務(wù)配置:
sed -i 's@SELINUX=enforcing@SELINUX=disabled@g' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld

創(chuàng)新互聯(lián)是一家專業(yè)提供廣安企業(yè)網(wǎng)站建設(shè),專注與成都網(wǎng)站設(shè)計、網(wǎng)站建設(shè)、H5建站、小程序制作等業(yè)務(wù)。10年已為廣安眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站設(shè)計公司優(yōu)惠進(jìn)行中。

echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
echo "vm.swappiness=10" >> /etc/sysctl.conf
echo 10 > /proc/sys/vm/swappiness
echo "net.core.somaxconn=65535" >> /etc/sysctl.conf
echo "net.ipv4.tcp_max_syn_backlog=65535" >> /etc/sysctl.conf
echo "net.ipv4.tcp_max_syn_backlog=65535" >> /etc/sysctl.conf
echo "net.core.somaxconn=65535" >> /etc/sysctl.conf
echo " soft nofile 288000" >> /etc/security/limits.conf
echo "
hard nofile 288000" >> /etc/security/limits.conf
sysctl -p

關(guān)閉大頁內(nèi)存:
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.d/rc.local
echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag" >> /etc/rc.d/rc.local
chmod a+x /etc/rc.d/rc.local

操作系統(tǒng)ntp服務(wù)設(shè)置:
#檢查當(dāng)前系統(tǒng)時區(qū),如果不是上海,修改為上海
timedatectl |grep "Time zone"
timedatectl set-timezone Asia/Shanghai
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

安裝ntp服務(wù)
yum install ntpdate -y
#寫入定時任務(wù)同步時間
crontab -e
0-59/10 /usr/sbin/ntpdate ntp1.aliyun.com | logger -t NTP
#測試同步時間是否可以成功
/usr/sbin/ntpdate ntp1.aliyun.com

服務(wù)部署、依賴部署:
yum install gcc wget -y

2.redis軟件下載及安裝:
cd /usr/local
wget http://download.redis.io/releases/redis-4.0.11.tar.gz
tar xvzf redis-4.0.11.tar.gz
ln -s redis-4.0.11 redis
cd redis
make
make install
cd ~

vim .bash_profile
PATH=$PATH:$HOME/bin:/usr/local/redis/src
source .bash_profile
#驗證是否安裝成功,如果出現(xiàn)版本號則說明安裝成功:
redis-cli -v

mkdir -p /data/redis-6379/logs/
mkdir -p /data/redis-6379/run/
編輯redis配置文件:
根據(jù)需要修改maxmemory和port參數(shù)以及對應(yīng)的bind,例如端口號為6379,sed -i 's/6379/xxxx/g' xxxx.conf
配置文件port6379,IP地址192.168.56.201:

bind 127.0.0.1 192.168.56.201
protected-mode no
port 6379
tcp-backlog 10000
timeout 0
tcp-keepalive 60
daemonize yes
supervised no
pidfile "/data/redis-6379/run/redis_6379.pid"
loglevel notice
logfile "/data/redis-6379/logs/6379.log"
databases 16
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename "dump6379.rdb"
dir "/data/redis-6379"
#slaveof 192.168.56.201 6379 #master ip地址和端口
slave-serve-stale-data yes
slave-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-timeout 60
repl-disable-tcp-nodelay no
repl-backlog-size 10mb
repl-backlog-ttl 3600
slave-priority 100
maxclients 10000
maxmemory 5000000kb
maxmemory-policy volatile-lru
appendonly yes
appendfilename "appendonly6379.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 0
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 1000
slowlog-max-len 1000
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 512mb 128mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes

啟動Redis:
redis-server /data/redis-6379/6379.conf
登錄:
redis-cli -p 6379
添加定時任務(wù)定時做rdb備份和aof備份:
0 redis-cli -p 6379 bgsave
0 1 * redis-cli -p 6379 BGREWRITEAOF


分享題目:redis安裝配置參考
網(wǎng)頁網(wǎng)址:http://weahome.cn/article/psjejo.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部