redis 源碼安裝

來源:互聯網
上載者:User

標籤:reids

下載redis源碼包到/opt/解壓並改名為redis,也可以直接從官網下載上傳至伺服器安裝目錄

[email protected]:/opt/redis/logs# cd /opt/

[email protected]:/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

[email protected]:/opt# 

建立必要的檔案目錄

[email protected]:/opt/redis# cd /opt/redis/;mkdir {conf,data,logs,bin,pids}

[email protected]:/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

[email protected]:/opt/redis# 

執行make並copy可執行檔到/opt/redis/bin目錄

[email protected]:/opt/redis# make

[email protected]:/opt/redis# cp src/{redis-cli,redis-server,redis-sentinel,redis-check-rdb,redis-check-aof} ../bin -rp

[email protected]:/opt/redis# ls bin/

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

[email protected]:/opt/redis# 

執行安裝指令碼

[email protected]:/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!

[email protected]:/opt/redis/utils# /etc/init.d/redis_6379 stop

Stopping ...

Redis stopped

[email protected]:/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 


本文出自 “linux系統” 部落格,請務必保留此出處http://rovkxu.blog.51cto.com/4358086/1834844

redis 源碼安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.