[redis]使用源碼安裝redis

一,下載源碼

1,可以直接去官網(wǎng)(redis.io)下載源碼。
2,linux直接下載(本文使用redis-6.2.1版本為例)。

wget https://download.redis.io/releases/redis-6.2.1.tar.gz

二,解壓及編譯

tar xzf redis-6.2.1.tar.gz
cd redis-6.2.1
make

三,運行測試程序

然后在src目錄下生成redis服務(wù)端程序redis-server和redis客戶端程序redis-cli。

省去其他的多余內(nèi)容
rw-r--r-- 1 root root    12944 Mar 18 13:57 mt19937-64.o
-rwxr-xr-x 1 root root 12698168 Mar 18 13:57 redis-server*
-rwxr-xr-x 1 root root 12698168 Mar 18 13:57 redis-sentinel*
-rw-r--r-- 1 root root      363 Mar 18 13:57 redis-cli.d
-rw-r--r-- 1 root root  1386024 Mar 18 13:57 redis-cli.o
-rw-r--r-- 1 root root      191 Mar 18 13:57 cli_common.d
-rw-r--r-- 1 root root    17376 Mar 18 13:57 cli_common.o
-rwxr-xr-x 1 root root  7187040 Mar 18 13:57 redis-cli*
-rw-r--r-- 1 root root      408 Mar 18 13:57 redis-benchmark.d
-rw-r--r-- 1 root root   908016 Mar 18 13:57 redis-benchmark.o
-rwxr-xr-x 1 root root  7269584 Mar 18 13:57 redis-benchmark*
-rwxr-xr-x 1 root root 12698168 Mar 18 13:57 redis-check-rdb*
drwxrwxr-x 3 root root    12288 Mar 18 13:57 ./
-rwxr-xr-x 1 root root 12698168 Mar 18 13:57 redis-check-aof*

運行redis服務(wù)端程序:

root@iZbp19tzbfkht2jgiwxh2eZ:/home/redis/redis-6.2.1/src# ./redis-server 
275187:C 18 Mar 2021 13:58:03.591 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
275187:C 18 Mar 2021 13:58:03.591 # Redis version=6.2.1, bits=64, commit=00000000, modified=0, pid=275187, just started
275187:C 18 Mar 2021 13:58:03.591 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
275187:M 18 Mar 2021 13:58:03.591 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.1 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 275187
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

275187:M 18 Mar 2021 13:58:03.592 # Server initialized
275187:M 18 Mar 2021 13:58:03.592 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
275187:M 18 Mar 2021 13:58:03.592 * Ready to accept connections

運行客戶端程序:

root@iZbp19tzbfkht2jgiwxh2eZ:/home/redis/redis-6.2.1/src# ./redis-cli 
127.0.0.1:6379> keys *
1) "foo1"
2) "foo"
127.0.0.1:6379> 
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容