安裝redis2.6.1.4版本
阿新 • • 發佈:2019-01-10
1.配置ip
nmcli connection modify 'System eth0' ipv4.method manual ipv4.addresses '172.25.0.168/24 172.25.0.254' connection.autoconnect yes
2.修改主機名: hostnamectl set-hostname redis
3.配置yum源: cd /etc/yum.repos.d/ [[email protected] ~]# cat /etc/yum.repos.d/dvd.repo [dvd] name=dvd #baseurl=file:///var/ftp/rhel7 baseurl=ftp://192.168.4.254/rhel7 enabled=1 gpgcheck=0
4.解決依賴關係: yum -y install gcc gcc-c++
5.編譯安轉redis [ [email protected] ~]# cd redis-2.6.14/
[[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]# make && make install
6.修改配置檔案: [[email protected] redis-2.6.14]# cp redis.conf redis.conf.bak [[email protected] redis-2.6.14]# vim redis.conf 17 daemonize yes 25 port 6399 30 bind 127.0.0.1 31 bind 192.168.4.10 56 tcp-keepalive 511
7.指定配置檔案的路徑 [ [email protected] redis-2.6.14]# mkdir -p /etc/redis/
[[email protected] redis-2.6.14]# cp redis.conf /etc/redis
8.啟動服務 [[email protected] redis-2.6.14]# /usr/local/bin/redis-server /etc/redis/redis.conf
9.檢視程序和埠 [[email protected] redis-2.6.14]# ss -ntulp | grep redis tcp LISTEN 0 128 192.168.4.10:6399 *:* users:(("redis-server",pid=4627,fd=4))
[[email protected] redis-2.6.14]# ps -C redis-server PID TTY TIME CMD 4627 ? 00:00:00 redis-server [[email protected] redis-2.6.14]# ps -ef | grep redis root 4627 1 0 12:30 ? 00:00:00 /usr/local/bin/redis-server /etc/redis/redis.conf root 4659 2377 0 12:33 pts/0 00:00:00 grep --color=auto redis
10.使用redis的服務: [[email protected] redis-2.6.14]# redis-cli -h 192.168.4.10 -p 6399 redis 192.168.4.10:6399> exit
11.關閉服務: [[email protected] utils]# redis-cli -h 192.168.4.10 -p 6399 shutdown [[email protected] utils]# ss -ntulp | grep redis [[email protected] utils]# ps -C redis-server PID TTY TIME CMD
12.重新開啟服務: [[email protected] utils]# /usr/local/bin/redis-server /etc/redis/redis.conf [[email protected] utils]# ps -C redis-server PID TTY TIME CMD 6283 ? 00:00:00 redis-server [[email protected] utils]# ss -ntulp | grep redis tcp LISTEN 0 128 192.168.4.10:6399 *:* users:(("redis-server",pid=6283,fd=4))
13.檢視redis 的版本號碼:
[[email protected] utils]# redis-server --version Redis server v=2.6.14 sha=00000000:0 malloc=jemalloc-3.2.0 bits=64
2.修改主機名: hostnamectl set-hostname redis
3.配置yum源: cd /etc/yum.repos.d/ [[email protected] ~]# cat /etc/yum.repos.d/dvd.repo [dvd] name=dvd #baseurl=file:///var/ftp/rhel7 baseurl=ftp://192.168.4.254/rhel7 enabled=1 gpgcheck=0
4.解決依賴關係: yum -y install gcc gcc-c++
5.編譯安轉redis [
6.修改配置檔案: [[email protected] redis-2.6.14]# cp redis.conf redis.conf.bak [[email protected] redis-2.6.14]# vim redis.conf 17 daemonize yes 25 port 6399 30 bind 127.0.0.1 31 bind 192.168.4.10 56 tcp-keepalive 511
7.指定配置檔案的路徑 [
8.啟動服務 [[email protected] redis-2.6.14]# /usr/local/bin/redis-server /etc/redis/redis.conf
9.檢視程序和埠 [[email protected] redis-2.6.14]# ss -ntulp | grep redis tcp LISTEN 0 128 192.168.4.10:6399 *:* users:(("redis-server",pid=4627,fd=4))
[[email protected] redis-2.6.14]# ps -C redis-server PID TTY TIME CMD 4627 ? 00:00:00 redis-server [[email protected] redis-2.6.14]# ps -ef | grep redis root 4627 1 0 12:30 ? 00:00:00 /usr/local/bin/redis-server /etc/redis/redis.conf root 4659 2377 0 12:33 pts/0 00:00:00 grep --color=auto redis
10.使用redis的服務: [[email protected] redis-2.6.14]# redis-cli -h 192.168.4.10 -p 6399 redis 192.168.4.10:6399> exit
11.關閉服務: [[email protected] utils]# redis-cli -h 192.168.4.10 -p 6399 shutdown [[email protected] utils]# ss -ntulp | grep redis [[email protected] utils]# ps -C redis-server PID TTY TIME CMD
12.重新開啟服務: [[email protected] utils]# /usr/local/bin/redis-server /etc/redis/redis.conf [[email protected] utils]# ps -C redis-server PID TTY TIME CMD 6283 ? 00:00:00 redis-server [[email protected] utils]# ss -ntulp | grep redis tcp LISTEN 0 128 192.168.4.10:6399 *:* users:(("redis-server",pid=6283,fd=4))
13.檢視redis 的版本號碼:
[[email protected] utils]# redis-server --version Redis server v=2.6.14 sha=00000000:0 malloc=jemalloc-3.2.0 bits=64