日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

redis 源码安装

發(fā)布時(shí)間:2025/3/18 编程问答 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 redis 源码安装 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

下載redis源碼包到/opt/解壓并改名為redis,也可以直接從官網(wǎng)下載上傳至服務(wù)器安裝目錄

root@apiserver01:/opt/redis/logs# cd /opt/

root@apiserver01:/opt# ls

install_saltminion.sh? install_zabbixagent.sh? nimsoft? redis? redis-3.2.1.tar.gz? zabbix-release_2.4-1+wheezy_all.deb? zeus

root@apiserver01:/opt#?

建立必要的文件目錄

root@apiserver01:/opt/redis# cd /opt/redis/;mkdir {conf,data,logs,bin,pids}

root@apiserver01:/opt/redis# ls

00-RELEASENOTES? BUGS? CONTRIBUTING? data? INSTALL? Makefile? ?README.md? ?runtest? ? ? ? ? runtest-sentinel? src? ? utils

bin? ? ? ? ? ? ? conf? COPYING? ? ? ?deps? logs? ? ?MANIFESTO? redis.conf? runtest-cluster? sentinel.conf? ? ?tests

root@apiserver01:/opt/redis#?

執(zhí)行make并copy可執(zhí)行文件到/opt/redis/bin目錄

root@apiserver01:/opt/redis# make

root@apiserver01:/opt/redis# cp src/{redis-cli,redis-server,redis-sentinel,redis-check-rdb,redis-check-aof} ../bin -rp

root@apiserver01:/opt/redis# ls bin/

redis-check-aof? redis-check-rdb? redis-cli? redis-sentinel? redis-server

root@apiserver01:/opt/redis#?

執(zhí)行安裝腳本

root@apiserver02:/opt/redis/utils# ./install_server.sh?

Welcome to the redis service installer

This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379]?

Selecting default: 6379

Please select the redis config file name [/etc/redis/6379.conf] /opt/redis/conf/6379.conf

Please select the redis log file name [/var/log/redis_6379.log] /opt/redis/logs/redis_6379.log

Please select the data directory for this instance [/var/lib/redis/6379] /opt/redis/data

Please select the redis executable path [] /opt/redis/bin/redis-server

Selected config:

Port? ? ? ? ? ?: 6379

Config file? ? : /opt/redis/conf/6379.conf

Log file? ? ? ?: /opt/redis/logs/redis_6379.log

Data dir? ? ? ?: /opt/redis/data

Executable? ? ?: /opt/redis/bin/redis-server

Cli Executable : /opt/redis/bin/redis-cli

Is this ok? Then press ENTER to go on or Ctrl-C to abort.

Copied /tmp/6379.conf => /etc/init.d/redis_6379

Installing service...

update-rc.d: using dependency based boot sequencing

insserv: warning: script 'K01apf' missing LSB tags and overrides

insserv: warning: script 'apf' missing LSB tags and overrides

Success!

Starting Redis server...

Installation successful!

root@apiserver02:/opt/redis/utils# /etc/init.d/redis_6379 stop

Stopping ...

Redis stopped

root@apiserver02:/opt/redis/utils#?

啟動(dòng)并查看日志

2571:M 09 Jul 17:36:51.448 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

2571:M 09 Jul 17:36:51.448 # Server started, Redis version 3.2.1

2571:M 09 Jul 17:36:51.448 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf?

and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

2571:M 09 Jul 17:36:51.449 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run?

the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after?

THP is disabled.?

修改系統(tǒng)參數(shù),解決redis啟動(dòng)WARNING

echo 511 >? /proc/sys/net/core/somaxconn

echo "vm.overcommit_memory = 1” >> ?/etc/sysctl.conf?

echo never > /sys/kernel/mm/transparent_hugepage/enabled?


轉(zhuǎn)載于:https://blog.51cto.com/rovkxu/1834844

總結(jié)

以上是生活随笔為你收集整理的redis 源码安装的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。