1. 程式人生 > >在centos7下部署redis2.6.14版本

在centos7下部署redis2.6.14版本

1.下載redis 2.6.14版本

2.練習環境

[[email protected] ~]# scp -r /root/桌面/redis/redis-2.6.14/ 192.168.4.2:/root/

3.安裝環境的準:

[[email protected] ~]# ls
anaconda-ks.cfg redis-2.6.14

4.解除依賴環境(因為redis 是c語言編寫)

[[email protected] ~]# yum -y install gcc gcc-c++

5.進入目錄,編譯安裝

[[email protected] ~]# cd redis-2.6.14/
[

[email protected] redis-2.6.14]# make && make install

[[email protected] redis-2.6.14]# ls
00-RELEASENOTES COPYING Makefile redis.conf src
BUGS deps MANIFESTO runtest tests
CONTRIBUTING INSTALL README sentinel.conf utils
[[email protected] redis-2.6.14]# cd utils/
[

[email protected] utils]# ls
build-static-symbols.tcl redis-copy.rb speed-regression.tcl
generate-command-help.rb redis_init_script whatisdoing.sh
install_server.sh redis_init_script.tpl
mkrelease.sh redis-sha1.rb

6.需要設定配置檔案的路徑:

[[email protected] utils]# mkdir -p /etc/redis/
[

[email protected] redis-2.6.14]# cp redis.conf /etc/redis/

7.修改配置檔案,修改指定項

[[email protected] redis-2.6.14]# vim /etc/redis/redis.conf
17 daemonize yes
17行:把no修改為yes

:wq

8.啟動服務:

[[email protected] redis-2.6.14]# /usr/local/bin/redis-server /etc/redis/redis.conf

檢視埠和程序:

[[email protected] redis-2.6.14]# ps -ef | grep redis
root 3375 1 0 11:00 ? 00:00:00 /usr/local/bin/redis-server /etc/redis/redis.conf
root 3379 1283 0 11:01 pts/0 00:00:00 grep --color=auto redis
[[email protected] redis-2.6.14]# ss -nutlp | grep :6379
tcp LISTEN 0 128 *:6379 : users:((“redis-server”,pid=3375,fd=4))

10.本機使用redis服務:

[[email protected] redis-2.6.14]# redis-cli
redis 127.0.0.1:6379> set name david
OK
redis 127.0.0.1:6379> get name
“david”
redis 127.0.0.1:6379> exit

11.安裝說明:

這次的安裝沒有修改指定的埠,和修改指定的使用ip 沒有使用指定的啟動腳步進行關閉和開啟服務