欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Redis 單節(jié)點部署的實現(xiàn)

 更新時間:2022年06月27日 09:38:58   作者:EOPG  
本文主要介紹了Redis 單節(jié)點部署的實現(xiàn),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧

第一步 下載Redis

下載地址:http://www.redis.cn/download/

第二步 安裝Redis

[root@localhost /]# cd /home/logonuser/app/
[root@localhost app]# ll
總用量 2180
-rw-r--r--. 1 root root 2228781 12月 17 15:58 redis-6.0.6.tar.gz
[root@localhost app]# tar xzf redis-6.0.6.tar.gz 
[root@localhost app]# ll
總用量 2184
drwxrwxr-x. 7 root root    4096 7月  21 2020 redis-6.0.6
-rw-r--r--. 1 root root 2228781 12月 17 15:58 redis-6.0.6.tar.gz
[root@localhost app]# cd redis-6.0.6/
[root@localhost redis-6.0.6]# ll
總用量 260
-rw-rw-r--.  1 root root 80561 7月  21 2020 00-RELEASENOTES
-rw-rw-r--.  1 root root    51 7月  21 2020 BUGS
-rw-rw-r--.  1 root root  2381 7月  21 2020 CONTRIBUTING
-rw-rw-r--.  1 root root  1487 7月  21 2020 COPYING
drwxrwxr-x.  6 root root   124 7月  21 2020 deps
-rw-rw-r--.  1 root root    11 7月  21 2020 INSTALL
-rw-rw-r--.  1 root root   151 7月  21 2020 Makefile
-rw-rw-r--.  1 root root  6888 7月  21 2020 MANIFESTO
-rw-rw-r--.  1 root root 20806 7月  21 2020 README.md
-rw-rw-r--.  1 root root 83392 7月  21 2020 redis.conf
-rwxrwxr-x.  1 root root   275 7月  21 2020 runtest
-rwxrwxr-x.  1 root root   280 7月  21 2020 runtest-cluster
-rwxrwxr-x.  1 root root   679 7月  21 2020 runtest-moduleapi
-rwxrwxr-x.  1 root root   281 7月  21 2020 runtest-sentinel
-rw-rw-r--.  1 root root 10743 7月  21 2020 sentinel.conf
drwxrwxr-x.  3 root root  4096 7月  21 2020 src
drwxrwxr-x. 11 root root   182 7月  21 2020 tests
-rw-rw-r--.  1 root root  3055 7月  21 2020 TLS.md
drwxrwxr-x.  9 root root  4096 7月  21 2020 utils
[root@localhost redis-6.0.6]# make

make 編譯完成以后提示 Hint: It’s a good idea to run ‘make test’ ?? 則安裝成功

如若在安裝中出現(xiàn)報錯:例如:

解決方式:

[root@localhost redis-6.0.6]# gcc -v                             
[root@localhost redis-6.0.6]# yum -y install centos-release-scl  
[root@localhost redis-6.0.6]# yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
[root@localhost redis-6.0.6]# scl enable devtoolset-9 bash
[root@localhost redis-6.0.6]# echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile

第三步 修改配置文件

[root@localhost redis-6.0.6]# gcc -v                             
[root@localhost redis-6.0.6]# yum -y install centos-release-scl  
[root@localhost redis-6.0.6]# yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
[root@localhost redis-6.0.6]# scl enable devtoolset-9 bash
[root@localhost redis-6.0.6]# echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile

要修改的配置文件內容:

? bind :

? port : 6385

? pidfile /var/run/redis_6385.pid

? daemonize yes 后臺運行

第四步 啟動服務

[root@localhost redis-6.0.6]# cd src/
[root@localhost src]# ls
[root@localhost src]# ./redis-server ../redis.conf 
13385:C 17 Dec 2021 17:28:01.835 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
13385:C 17 Dec 2021 17:28:01.835 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=13385, just started
13385:C 17 Dec 2021 17:28:01.835 # Configuration loaded
[root@localhost src]# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      690/rpcbind         
tcp        0      0 192.168.209.129:6385    0.0.0.0:*               LISTEN      13386/./redis-serve 
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1767/dnsmasq        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1184/sshd           
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1183/cupsd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1541/master         
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      3239/sshd: root@pts 
tcp6       0      0 :::111                  :::*                    LISTEN      690/rpcbind         
tcp6       0      0 :::22                   :::*                    LISTEN      1184/sshd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      1183/cupsd          
tcp6       0      0 ::1:25                  :::*                    LISTEN      1541/master         
tcp6       0      0 ::1:6010                :::*                    LISTEN      3239/sshd: root@pts 

檢測Redis是否安裝成功

[root@localhost src]# ./redis-cli -h 192.168.209.129 -p 6385
192.168.209.129:6385> set xiaohong hello-redis
OK
192.168.209.129:6385> get xiaohong
"hello-redis"
192.168.209.129:6385> 

到此這篇關于Redis 單節(jié)點部署的實現(xiàn)的文章就介紹到這了,更多相關Redis 單節(jié)點部署內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

  • Redis的Sentinel解決方案介紹與運行機制

    Redis的Sentinel解決方案介紹與運行機制

    這篇文章主要介紹了Redis的Sentinel解決方案介紹與運行機制, Sentinel 是一款面向分布式服務架構的輕量級流量控制組件,主要以流量為切入點,從流量控制、熔斷降級、系統(tǒng)自適應保護等多個維度來保障服務的穩(wěn)定性,需要的朋友可以參考下
    2023-07-07
  • springmvc集成使用redis過程

    springmvc集成使用redis過程

    這篇文章主要介紹了springmvc集成使用redis過程,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2021-11-11
  • Redis簡介

    Redis簡介

    Redis是一個開源,高級的鍵值存儲和一個適用的解決方案,用于構建高性能,可擴展的Web應用程序。關于redis的相關知識大家可以通過本教程學習
    2017-05-05
  • Redisson如何解決redis分布式鎖過期時間到了業(yè)務沒執(zhí)行完問題

    Redisson如何解決redis分布式鎖過期時間到了業(yè)務沒執(zhí)行完問題

    這篇文章主要介紹了Redisson如何解決redis分布式鎖過期時間到了業(yè)務沒執(zhí)行完問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • 詳解Redis基本命令與使用場景

    詳解Redis基本命令與使用場景

    REmote DIctionary Server(Redis)是一個由Salvatore Sanfilippo寫的key-value 存儲系統(tǒng),是跨平臺的非關系型數(shù)據(jù)庫,是一個開源的使用ANSI C語言編寫、遵守BSD協(xié)議、支持網絡、可基于內存、分布式、可選持久性的鍵值對(Key-Value)存儲數(shù)據(jù)庫,并提供多種語言的 API。
    2021-06-06
  • 利用Redis實現(xiàn)訪問次數(shù)限流的方法詳解

    利用Redis實現(xiàn)訪問次數(shù)限流的方法詳解

    這篇文章主要給大家介紹了關于如何利用Redis實現(xiàn)訪問次數(shù)限流的相關資料,文中通過實例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下
    2022-02-02
  • 基于Redis緩存數(shù)據(jù)常見的三種問題及解決

    基于Redis緩存數(shù)據(jù)常見的三種問題及解決

    這篇文章主要介紹了基于Redis緩存數(shù)據(jù)常見的三種問題及解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-06-06
  • redis-cli登錄遠程redis服務并批量導入數(shù)據(jù)

    redis-cli登錄遠程redis服務并批量導入數(shù)據(jù)

    本文主要介紹了redis-cli登錄遠程redis服務并批量導入數(shù)據(jù),文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2023-10-10
  • Redis連接超時異常的處理方法

    Redis連接超時異常的處理方法

    這篇文章主要給大家介紹了關于Redis連接超時異常的處理方法,文中通過示例代碼以及圖文介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面來一起學習學習吧
    2020-07-07
  • Redis實現(xiàn)單設備登錄的場景分析

    Redis實現(xiàn)單設備登錄的場景分析

    這篇文章主要介紹了Redis實現(xiàn)單設備登錄,用戶首次登錄時,將用戶信息存入Redis,key是用戶id,value是token,當用戶在其他設備登錄時,會重新生成token,這個時候原先的token已經被覆蓋了,本文給大家提供樣例及核心代碼,感興趣的朋友參考下吧
    2022-04-04

最新評論