当前位置:网站首页>安装Redis
安装Redis
2022-07-06 01:29:00 【冰点契约丶】
Redis安装
安装包获取
http://redis.io
http://redis.cn/(国内)
ubuntu系统安装Redis
sudo apt-get install redis-server
安装步骤
安装gcc:
yum install gcc sudo apt-get install gcc测试gcc是否安装成功
gcc --version下载redis.tar.gz到opt目录下
解压
tar -zxvf redis.tar.gz解压完成后进入Redis目录使用make命令进行编译
make如果没有准备好C语言编译环境,make会报错Jemalloc/jemalloc.h:没有那个文件
解决方案:运行make distclean
安装
make install安装目录:/usr/local/bin
- redis-benchmark:性能测试工具,可以在自己本子运行,看看自己本子性能如何
- redis-check-aof:修复有问题的AOF文件,rdb和aof后面讲
- redis-check-dump:修复有问题的dump.rdb文件
- redis-sentinel:Redis集群使用
- redis-server:Redis服务器启动命令
- redis-cli:客户端,操作入口
启动
运行命令:redis-server(前台启动)
后台启动:拷贝redis.conf到其他目录
cp /opt/redis/redis.conf /ect/redis.conf修改配置文件,打开后台启动
daemonize no -> yes启动服务:redis-server /etc/redis.conf
访问服务
redis-cli
测试与服务器连接是否正常,进行redis-cli,执行命令ping,显示pang则表示连接畅通
ping
关闭服务
- redis-cli shutdown 或者进入redis-cli终端执行shutdown
端口6379从何而来
- 根据人名:Merz(手机键盘9宫格)
- redis默认16个数据库,类似数组下标从0开始,初始默认使用0号库
- 使用select dbid来切换数据库
采用技术
memcached:多线程+锁
Redis:是单线程+多路IO复用技术
memcached不能将数据持久化到磁盘,而redis可以
边栏推荐
- Loop structure of program (for loop)
- [Jiudu OJ 09] two points to find student information
- SCM Chinese data distribution
- Basic operations of database and table ----- set the fields of the table to be automatically added
- Idea sets the default line break for global newly created files
- SPIR-V初窥
- Cookie concept, basic use, principle, details and Chinese transmission
- 500 lines of code to understand the principle of mecached cache client driver
- 晶振是如何起振的?
- About error 2003 (HY000): can't connect to MySQL server on 'localhost' (10061)
猜你喜欢

MATLB | real time opportunity constrained decision making and its application in power system

Basic operations of database and table ----- delete data table

Unity | 实现面部驱动的两种方式

File upload vulnerability test based on DVWA

MATLB|实时机会约束决策及其在电力系统中的应用

Electrical data | IEEE118 (including wind and solar energy)

You are using pip version 21.1.1; however, version 22.0.3 is available. You should consider upgradin

Mathematical modeling learning from scratch (2): Tools

Some features of ECMAScript

Threedposetracker project resolution
随机推荐
[flask] response, session and message flashing
Superfluid_ HQ hacked analysis
MUX VLAN configuration
How to extract MP3 audio from MP4 video files?
现货白银的一般操作方法
基于DVWA的文件上传漏洞测试
Basic operations of databases and tables ----- unique constraints
037 PHP login, registration, message, personal Center Design
MATLB|实时机会约束决策及其在电力系统中的应用
MCU lightweight system core
Loop structure of program (for loop)
Huawei Hrbrid interface and VLAN division based on IP
【Flask】响应、session与Message Flashing
leetcode刷题_验证回文字符串 Ⅱ
Electrical data | IEEE118 (including wind and solar energy)
Use of crawler manual 02 requests
干货!通过软硬件协同设计加速稀疏神经网络
Some features of ECMAScript
[solved] how to generate a beautiful static document description page
Blue Bridge Cup embedded stm32g431 - the real topic and code of the eighth provincial competition