redis 源码安装
下載redis源碼包到/opt/解壓并改名為redis,也可以直接從官網下載上傳至服務器安裝目錄
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#? |
執行make并copy可執行文件到/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#? |
執行安裝腳本
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#? |
啟動并查看日志
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.? |
修改系統參數,解決redis啟動WARNING
echo 511 >? /proc/sys/net/core/somaxconn echo "vm.overcommit_memory = 1” >> ?/etc/sysctl.conf? echo never > /sys/kernel/mm/transparent_hugepage/enabled? |
轉載于:https://blog.51cto.com/rovkxu/1834844
總結
以上是生活随笔為你收集整理的redis 源码安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: centos 6.5配置samba
- 下一篇: Win10启动盘制作工具