在终端下输入

sudo apt search redis

查找一下发现了 redis-server

如果找不到 你可能需要使用 update 更新一下了

sudo apt-get update

然后就安装

sudo apt-get install redis-server

安装完毕后启动 redis

/usr/bin/redis-server

启动后可以看到

21154:C 26 Jun 10:27:39.157 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
21154:C 26 Jun 10:27:39.157 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=21154, just started
21154:C 26 Jun 10:27:39.157 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/bin/redis-server /path/to/redis.conf
21154:M 26 Jun 10:27:39.157 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
21154:M 26 Jun 10:27:39.157 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
21154:M 26 Jun 10:27:39.157 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 21154
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' 21154:M 26 Jun 10:27:39.164 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
21154:M 26 Jun 10:27:39.164 # Server initialized
21154:M 26 Jun 10:27:39.164 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
21154:M 26 Jun 10:27:39.164 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
21154:M 26 Jun 10:27:39.164 * Ready to accept connections

然后开一个终端 进行cli访问

$ /usr/bin/redis-cli
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379> set user name
OK
127.0.0.1:6379> get user
"name"
127.0.0.1:6379>

好了,就是这么简单。

ubuntu如何安装redis的更多相关文章

  1. 在Ubuntu中安装Redis

    原文地址:http://blog.fens.me/linux-redis-install/ 在Ubuntu中安装Redis R利剑NoSQL系列文章,主要介绍通过R语言连接使用nosql数据库.涉及的 ...

  2. ubuntu下安装redis以及redis客户端在mac下的使用

    ubuntu下安装redis http://blog.fens.me/linux-redis-install/ 此方式利用brew安装包去获取最新的rdm客户端 资源失效了 https://www.j ...

  3. 转】在Ubuntu中安装Redis

    不多说,直接上干货! 原博文出自于: http://blog.fens.me/category/%E6%95%B0%E6%8D%AE%E5%BA%93/ 感谢! 在Ubuntu中安装Redis R利剑 ...

  4. Ubuntu上面安装Redis Python

    Ubuntu上面安装Redis Python 1,下载redis源码https://redis.io/download,下载地址:http://124.205.69.169/files/A092000 ...

  5. ubuntu上安装redis和配置远程访问

    ubuntu上安装redis和配置远程访问 安装redis: 下载安装包: wget http://download.redis.io/releases/redis-4.0.1.tar.gz 解压: ...

  6. ubuntu 卸载/安装 redis

    ubuntu 卸载redis 1. 卸载软件 apt-get remove redis 2. 清除配置 apt-get remove --purge redis 3. 删除残留文件 find / -n ...

  7. Ubuntu下安装Redis并实现远程访问

    之前的一篇随笔写到Redis在Windows下的安装,但目前好多大数据处理的服务是在Linux上的,所以想以Redis为例并实现在Windows上利用C#代码远程访问. 以在Ubuntu下为例,步骤如 ...

  8. ubuntu下安装redis及常用操作

    reids是一个内存数据库,具有存取速度快,使用简单等优点.我们常常在分布式或者负载均衡的系统中使用它来缓存一些公用的且不是很大量的数据,比如session或者各类token(比如微信的access_ ...

  9. ubuntu上安装redis

    1.Redis简要介绍 访问Redis官方网站 https://redis.io/ 上面介绍到 ,redis是开源,BSD许可,高级的key-value存储系统,可以用来存储字符串,哈希结构,链表,集 ...

  10. Linux(ubuntu)安装redis集群,redis集群搭建

    今天学习一下redis集群的搭建.redis在现在是很常用的数据库,在nosql数据库中也是非常好用的,接下来我们搭建一下redis的集群. 一.准备 首先我们要安装c语言的编译环境,我们要安装red ...

随机推荐

  1. Linux 检查端口监听情况

    使用 lsof $ sudo lsof -i :22 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sshd 963 root 3u IPv4 ...

  2. ServletConfig 类和ServletContext 类

    ServletConfig 类 ServletConfig 类从类名上来看,就知道是 Servlet 程序的配置信息类. Servlet 程序和 ServletConfig 对象都是由 Tomcat ...

  3. 【YashanDB知识库】如何使用yasldr导入lob类型?

    问题现象 在各个项目实施中,有时候会使用到yasldr工具进行csv数据的导入.关于yasldr一般的使用方法,官方文档已经有详细的介绍,具体可见:yasldr使用指导.但在涉及LOB类型的导入时,会 ...

  4. 【YashanDB知识库】YashanDB的JDBC/OCI驱动如何设置字符编码

    问题现象 Oracle.Mysql数据库链接串,JDBC驱动连接串可以指定客户端的编码格式: jdbc:mysql://hostname:port/database_name?useUnicode=t ...

  5. 工具 – Cypress

    介绍 Cypress 是一款 e2e 测试工具.每当我们写好一个组件或者一个页面之后,我们会想对整体做一个测试. 在不使用工具的情况下,我们会开启 browser,然后做一系列点击.滚动.填 form ...

  6. MyBatis——案例——查询-多条件查询(多参数接收的三种方法)

    查询-多条件查询   编写接口方法:Mapper接口       参数:所有条件查询 List<Brand> selectByCondition(int status,String com ...

  7. namenode rpc 请求队列调优

    当 datanode 上新写完一个块,默认会立即汇报给 namenode.在一个大规模 Hadoop 集群上,每时每刻都在写数据,datanode 上随时都会有写完数据块然后汇报给 namenode ...

  8. SpringBoot注解大全(详细)

    1. @ActiveProfiles 用来声明活动的profile–@ActiveProfiles("prod"(这个prod定义在配置类中)) @RunWith(SpringRu ...

  9. MSF使用方法

    https://blog.csdn.net/weixin_45588247/article/details/119614618https://github.com/ttonys/Scrapy-CVE- ...

  10. MyBatis动态增改,多字段模糊查询

    示例: insert insert into bargain_products <trim prefix="(" suffix=")" suffixOve ...