Linux服务器运行环境搭建(二)——Redis数据库安装
官網(wǎng)地址:http://redis.io/
官網(wǎng)下載地址:http://redis.io/download
?
1. 下載Redis源碼(tar.gz),并上傳到Linux
2. 解壓縮包:tar zxvf redis-2.8.17.tar.gz
3. 進入解壓縮后的文件夾:cd redis-2.8.17
4. 編譯源碼:make
(1)若出現(xiàn)如下提示,則說明未安裝gcc,使用命令安裝gcc:yum install gcc
[root@localhost redis-2.8.17]# make cd src && make all make[1]: Entering directory `/root/redis-2.8.17/src' CC adlist.o /bin/sh: cc: command not found make[1]: *** [adlist.o] Error 127 make[1]: Leaving directory `/root/redis-2.8.17/src' make: *** [all] Error 2(2)若出現(xiàn)如下提示,則將make改為make MALLOC=libc,推測是因為編譯庫的問題。
[root@localhost redis-2.8.17]# make cd src && make all make[1]: Entering directory `/root/redis-2.8.17/src' CC adlist.o In file included from adlist.c:34: 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 make[1]: Leaving directory `/root/redis-2.8.17/src' make: *** [all] Error 25. 安裝編譯后的文件:make install,redis可執(zhí)行文件將被復(fù)制到/usr/local/bin/,但沒有配置,手動復(fù)制配置:cp redis.conf /usr/local/bin
6. 設(shè)置Redis密碼,編輯剛剛復(fù)制的配置文件:vi redis.conf,解除requirepass參數(shù)的注釋,并設(shè)置值,例如:requirepass ljx520
7. 使用配置文件啟動Redis數(shù)據(jù)庫:./redis-server redis.conf
如果看到如下的界面,那么恭喜你,Redis已安裝成功
轉(zhuǎn)載于:https://www.cnblogs.com/emberd/p/4689900.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的Linux服务器运行环境搭建(二)——Redis数据库安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 表变量和临时表的使用
- 下一篇: 并发模型之——共享内存模型(线程与锁)理