Redis 5 雙系統安裝

2021-10-01 16:43:42 字數 2405 閱讀 4161

windows 10 和 centos 8  redis 安裝

2.安裝

一直下一步即可

3.配置環境變數

path新增c:\program files\redis

4.redis配置

本人預設安裝找到c:\program files\redis\redis.windows-service.conf

redis.windows-service.conf檔案移到桌面,不移動會無法儲存(提示無許可權)

開啟配置密碼

將註解解開配置密碼例如:requirepass 123456

注意:daemonize yes  守護程序模式開啟(windows不支援設定)

重啟redis服務

配置

#建立目錄

mkdir -p /opt/software/redis/6379

#解壓(到壓縮包所在目錄)

tar zxvf redis-5.0.7.tar.gz -c /opt/software/redis/6379

#切換目錄

cd  /opt/software/redis/6379/redis-5.0.7

yum -y install gcc automake autoconf libtool make
#編譯

make

#編譯測試

make test

#再次編譯測試

make test

make install

#預設安裝在/usr/local/

mkdir /etc/redis

cp redis.conf /etc/redis/6379.conf

#編輯配置檔案

vi /etc/redis/6379.conf

# 注釋掉允許其它主機訪問

#bind 127.0.0.1

#關閉保護模式

#關閉protected-mode模式,此時外部網路可以直接訪問

#開啟protected-mode保護模式,需配置bind ip或者設定訪問密碼

protected-mode no

# 守護程序模式開啟

daemonize yes

# 設定密碼

requirepass 密碼

#日誌(需建立這個檔案 建立目錄:mkdir -p /opt/log/redis ,建立檔案:touch /opt/log/redis/6379.log)

logfile "/opt/log/redis/6379.log"

#修改埠

port 6379

#修改埠同時修改pid

pidfile /var/run/redis_6379.pid

redis-server
ps aux|grep redis(檢視程序號)

kill 程序號(關閉)

或使用redis提供的客戶端來關閉服務

命令為:

redis-cli shutdown

修改過埠號使用

redis-cli -p 埠號 shutdown

redis客戶端連線

redis-cli 或 redis-cli -p 埠號

1.回到壓縮包複製檔案

[root@localhost redis-5.0.7]# p utils/redis_init_script /etc/init.d/redis
2.配置

配置好重啟伺服器reboot

2.1開機啟動服務

2.2防護牆開放

Ubuntu18安裝redis5,啟動

wget 3.進入解壓後的資料夾,cd redis 5.0.7 4.給與全部檔案執行許可權chmod 777 5.當前目錄執行make 6.當前目錄執行make test,報錯,you need tcl 8.5 or newer in order to run the redis test 安裝tc...

ubuntu16雙系統安裝

電腦型號lenovo y50 70,系統為windows8,磁碟為mbr bios 即bios設定裡為legacy support 安裝前按f12,u盤無法被讀取 關閉windows下快速啟動 bios設定裡切到uefi模式下把secure boot關了 bios下拔了u盤又插回去 不確定哪個起效,...

安裝ubuntu14 04雙系統

ubuntu 14.04 lts 64bit 的iso映象檔案 1 linux下安裝ubuntu,直接將啟動盤插入電腦,按f2或者f12進入bios,使用u盤啟動,進行分割槽操作,可以儲存原始系統或直接刪除覆蓋,建立新系統。2 window下安裝ubuntu,先給磁碟進行分割槽 1 開機後無法進入系...