############################
成都創(chuàng)新互聯(lián)成立十多年來,這條路我們正越走越好,積累了技術(shù)與客戶資源,形成了良好的口碑。為客戶提供成都網(wǎng)站建設、做網(wǎng)站、網(wǎng)站策劃、網(wǎng)頁設計、域名與空間、網(wǎng)絡營銷、VI設計、網(wǎng)站改版、漏洞修補等服務。網(wǎng)站是否美觀、功能強大、用戶體驗好、性價比高、打開快等等,這些對于網(wǎng)站建設都非常重要,成都創(chuàng)新互聯(lián)通過對建站技術(shù)性的掌握、對創(chuàng)意設計的研究為客戶提供一站式互聯(lián)網(wǎng)解決方案,攜手廣大客戶,共同發(fā)展進步。
基礎環(huán)境
OS: centos 6.6
DB: redis 3.0.7
#############################
1.下載源碼包,穩(wěn)定版本
http://redis.io/ -->Download it -->download 3.0.7.
2.上傳到服務器/usr/local目錄下,解壓縮
#cd /usr/local
# tar -zxvf redis-3.0.7.tar.gz
3.編譯
# cd redis-3.0.7
# make
#make test --可以省略
4.安裝
# make install
5.安裝數(shù)據(jù)庫設置,可以設置不同端口,多個實例
# ./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]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis/6379.conf
Log file : /var/log/redis_6379.log
Data dir : /var/lib/redis/6379
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/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...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
6.驗證
# ps -ef |grep redis
# chkconfig --list |grep redis
redis_6379 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# redis-cli -p 6379
127.0.0.1:6379> info
7.啟停
#service redis_6379 stop
#service redis_6379 start
8.問題總結(jié):
1)安裝gcc、jemalloc
# yum -y install gcc
# rpm -ivh jemalloc-3.6.0-1.el6.x86_64.rpm
2)make時報如下錯誤,一定要用jemalloc
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
原因是jemalloc重載了Linux下的ANSI C的malloc和free函數(shù)。解決辦法:make時添加參數(shù)。
解決方法:
#make MALLOC=libc
3)make之后,會出現(xiàn)一句提示
Hint: To run 'make test' is a good idea ;)
但是不測試,通常是可以使用的。若我們運行make test ,會有如下提示
#make test
You need tcl 8.5 or newer in order to run the Redis test
make: ***[test] Error_1
解決辦法是用yum安裝tcl8.5(或去tcl的官方網(wǎng)站http://www.tcl.tk/下載8.5版本,并參考官網(wǎng)介紹進行安裝)
#yum install tcl
4)編譯測試報錯
*** [err]: Test replication partial resync: no backlog (diskless: no, reconnect: 1) in tests/integration/replication-psync.tcl
Expected condition '[s -1 sync_partial_err] > 0' to be true ([s -1 sync_partial_err] > 0)
Cleanup: may take some time... OK
make[1]: *** [test] 錯誤 1
make[1]: Leaving directory `/usr/local/redis-3.0.7/src'
make: *** [test] 錯誤 2
解決辦法:
在速度較慢的機器上執(zhí)行make test可能出現(xiàn)下列錯誤,無影響
分享標題:redis3.0.7安裝部署
文章起源:http://sd-ha.com/article38/gcjepp.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設、企業(yè)網(wǎng)站制作、企業(yè)建站、標簽優(yōu)化、ChatGPT、App開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)