我是新手,中間遇到的過程做備忘,可能都是很淺顯的問題。
空白的ubuntu server,一步一步來。
1、首先在ubuntu server里面安裝openssh server,通過tasksel命令調出task,選擇openssh server進行安裝。
2、我一般用windows辦公,直接用putty,通過ip和port連接服務器,注意一點的就是connection的seconds between keepalives設置時間稍微長一些,畢竟通信過程有延遲。
3、用wget下載redis的穩定版本,然后用tar解壓,進入到解壓目錄。執行make,提示make沒有安裝。
4、用sudo apt-get install make和sudo apt-get install gcc安裝兩個編譯器。
5、在redis解壓目錄下,執行make,如果提示“
error: jemalloc/jemalloc.h: No such file or directory”,則可以先執行指令:make distclean
6、make完后,一般建議make test,我在make test時提示“You need tcl 8.5 or newer in order to run the Redis test”
7、wget
http://prdownloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz,下載后,進入安裝目錄,進入unix,然后執行"./configure",然后make,然后make install
(告訴我沒有權限建立文件,在make前加上sudo)。8、然后跑到redis的解壓目錄下,再進行"make test",很多很多ok,哈哈。
9、然后make install,這樣以后執行命令不用上全路徑
10、開發環境中啟動:redis-server --port 6000,命令行客戶端:redis-cli -h 192.168.1.10 -p 6000,然后就可以用redis的各種命令交互了。
總結:我是老白,不過ubuntu server基于debian,真心很好用,debian的更新周期太長,所以ubuntu還是不錯的。
每次啟動redis,總是報告:Unable to set the max number of files limit
解決方案:
1.打開/etc/security/limits.conf,里面有很詳細的注釋,找到如下設置(如果沒有就插入)
* soft nofile 51200
* hard nofile 51200
2.編輯/etc/pam.d/common-session,加入一行
session required pam_limits.so
3.編輯/etc/profile,加入
ulimit -SHn 51200
重啟服務器,再次登陸,查看句柄數,已經正確設置為51200。
posted on 2014-01-16 15:04
不做浮躁的人 閱讀(3211)
評論(3) 編輯 收藏