解決 ubuntu 安裝redis無法啟動

2021-10-19 14:01:17 字數 2053 閱讀 7341

ubuntu 16.04

port 6379

redis version 5:4.0.9-1

apt install redis
errors were encountered while processing:

redis-server

redis

e: sub-process /usr/bin/dpkg returned an error code (1)

w: operation was interrupted before it could finish

root@iz2zeiudkwjc07o9jfa4fgz:/var/log/nginx# systemctl status redis-server.service

● redis-server.service - advanced key-value store

loaded: loaded (/lib/systemd/system/redis-server.service; disabled; vendor preset: enabled)

active: activating (start) since fri 2019-01-25 15:15:44 cst; 20s ago

docs:

man:redis-server(1)

process: 28248 execstart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/success)

tasks: 0 (limit: 2325)

cgroup: /system.slice/redis-server.service

jan 25 15:15:44 iz2zeiudkwjc07o9jfa4fgz systemd[1]: starting advanced key-value store...

jan 25 15:15:44 iz2zeiudkwjc07o9jfa4fgz systemd[1]: redis-server.service: can't open pid file /var/run/redis/redis-server.pid (yet?) after start: no such file or directory

cat /var/log/redis/redis-server.log

#提示 creating server tcp listening socket ::1:6379: bind: cannot assign requested address

oo0ooo0ooo0oo redis is starting oo0ooo0ooo0oo

主機上禁用了ipv6,而ubuntu的redis-server軟體包(版本5:4.0.9-1)附帶了:繫結127.0.0.1 :: 1

修改redis配置檔案中的 bind 位址;注釋 bind 位址或將 bind 位址修改為 0.0.0.0

vim /etc/redis/redis.conf

// 注釋bind位址

#bind 127.0.0.1 ::1

//或修改bind位址-並允許其開放訪問

bind 0.0.0.0

service redis-server start
systemctl status redis-server

//提示資訊

#redis-server.service - advanced key-value store

#active: active (running) since fri 2019-01-25 15:24:47 cst; 41min ago

netstat -ntpl | grep 6379

//提示資訊

#tcp 0 0 0.0.0.0:6379 0.0.0.0:* listen 28507/redis-serv

Ubuntu安裝redis教程

本教程使用linux版本為ubuntu 16.04.3,redis使用版本為 redis 2 採用解壓命令解壓壓縮檔案 sudo tar zxvf redis 3.2.6.tar.gz3 在 usr 下建立redis資料夾 mkdir usr redis 4 將解壓好的redis 3.2.6資料夾及...

ubuntu安裝啟動redis

進入目錄執行 make sudo make install 現在redis已經安裝完成 wget wget sudo mv redis server etc init.d redis server sudo chmod x etc init.d redis server sudo mv redis....

ubuntu安裝啟動redis

sudo apt get install build essential wget2.2.13.tar.gz tar zxf redis 2.2.13.tar.gz cd redis 2.2.13 make sudo make install 這時redis 的可執行檔案被放到了 usr local...