亚洲视频二区_亚洲欧洲日本天天堂在线观看_日韩一区二区在线观看_中文字幕不卡一区

公告:魔扣目錄網(wǎng)為廣大站長提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請做好本站友鏈:【 網(wǎng)站目錄:http://www.430618.com 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會(huì)員:747

前言

今天想試試最新版本的redis,于是乎發(fā)現(xiàn)Redis6.x版本要求多了。這里記錄下教程,需要的可以查看下。

CentOS7安裝最新版Redis6.0.9

 

第一步:升級Gcc

# yum -y install centos-release-scl
# yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils

# scl enable devtoolset-9 bash
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAppER=/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-9/root/usr --mandir=/opt/rh/devtoolset-9/root/usr/share/man --infodir=/opt/rh/devtoolset-9/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-9.3.1-20200408/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC) 

其中上面scl命令啟用只是臨時(shí)的,退出shell或重新打開一個(gè)shell就會(huì)恢復(fù)原系統(tǒng)gcc版本,所以需要執(zhí)行以下命令永久使用gcc 9。

# echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile

# . ~/.bash_profile 

# which gcc
/opt/rh/devtoolset-9/root/usr/bin/gcc

如果沒有生效環(huán)境變量,則需要重新登錄再看看gcc版本。

第二步:編譯

[testerzhang@VM-8-7-centos redis-6.0.9]$  mkdir -p bm/redis-6.0.9
[testerzhang@VM-8-7-centos redis-6.0.9]$  cd bm/redis-6.0.9
[testerzhang@VM-8-7-centos redis-6.0.9]$  wget https://download.redis.io/releases/redis-6.0.9.tar.gz?_ga=2.232216794.43188584.1606029760-1221876175.1606029760 -O redis-6.0.9.tar.gz
[testerzhang@VM-8-7-centos redis-6.0.9]$  tar zxf redis-6.0.9.tar.gz
[testerzhang@VM-8-7-centos redis-6.0.9]$  cd redis-6.0.9

[testerzhang@VM-8-7-centos redis-6.0.9]$ mkdir -p ~/3rd/redis-6.0.9
[testerzhang@VM-8-7-centos redis-6.0.9]$ make 
[testerzhang@VM-8-7-centos redis-6.0.9]$ make PREFIX=/home/testerzhang/3rd/redis-6.0.9 install
[testerzhang@VM-8-7-centos redis-6.0.9]$ cp redis.conf  ~/3rd/redis-6.0.9/bin/

查看編譯后的文件安裝目錄

[testerzhang@VM-8-7-centos bin]$ pwd
/home/testerzhang/3rd/redis-6.0.9/bin
[testerzhang@VM-8-7-centos bin]$ ls
redis-benchmark  redis-check-aof  redis-check-rdb  redis-cli  redis.conf  redis-sentinel  redis-server

啟動(dòng)Redis

  • 編輯配置文件(這里列舉一些重要的配置項(xiàng))
[testerzhang@VM-8-7-centos bin]$ pwd
/home/testerzhang/3rd/redis-6.0.9/bin
[testerzhang@VM-8-7-centos bin]$ vi redis.conf  
# bind 127.0.0.1 ::1
bind 127.0.0.1

#port 6379
port 16379

# requirepass foobared
requirepass testerzhang
  • 啟動(dòng)命令
$ ./redis-server redis.conf 

如果是后臺(tái)運(yùn)行,則可以加上nohup命令

$ nohup ./redis-server redis.conf & 

驗(yàn)證 Redis服務(wù)

[testerzhang@VM-8-7-centos bin]$ pwd
/home/testerzhang/3rd/redis-6.0.9/bin

[testerzhang@VM-8-7-centos bin]$ ./redis-cli -p 16379
127.0.0.1:16379> auth testerzhang
OK
127.0.0.1:16379> set name 123
OK
127.0.0.1:16379> get name
"123"

至此,Redis6.0.9版本安裝完畢。

 

結(jié)束

主要難在gcc的編譯,只要升級gcc版本成功后,其他操作都是很簡單。

 

對本文有疑問的可以聯(lián)系@testerzhang,喜歡的可以加個(gè)關(guān)注和點(diǎn)贊。

分享到:
標(biāo)簽:Redis
用戶無頭像

網(wǎng)友整理

注冊時(shí)間:

網(wǎng)站:5 個(gè)   小程序:0 個(gè)  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會(huì)員

趕快注冊賬號,推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學(xué)四六

運(yùn)動(dòng)步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動(dòng)步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績評定2018-06-03

通用課目體育訓(xùn)練成績評定