当前位置:网站首页>A brief introduction to redis, the installation and configuration of redis source code, and the installation and mounting of docker
A brief introduction to redis, the installation and configuration of redis source code, and the installation and mounting of docker
2022-07-21 02:22:00 【great-sun】
1. Get to know Redis
Redis Introduce
Redis(Remote Dictionary Server ), Remote dictionary service , It's an open source , Use C Language writing 、 Support network 、 Log type that can be memory based or persistent 、Key-Value database , And provide multilingual API.
characteristic
1、 database , fast , Very fast memory …
2、 Single thread worker, Serialization 、 Atomic manipulation .
3、IO Model (epoll), Support high concurrency .
4、kv Model ,v With type structure .
5、 Have local methods , Computing moves to data .
Linux install
1) Download the source code
wget https://github.com/redis/redis/archive/7.0.0.tar.gz
2) decompression
tar -zvxf 7.0.0.tar.gz
- Mobile directory
In general, I will redis Put the directory in /usr/local/redis Catalog .
mv redis-7.0.0 /usr/local/redis
4) compile
make && make install
5) start-up server
./src/redis-server
- Start client
./src/redis-cli
You can also specify IP And port
./src/redis-cli -h 123.57.206.19 -p 6379
7) Specify profile
./src/redis-server ./redis.conf
If external IP visit , Please amend as follows
Specify the modified configuration file , Start again , Just ok 了
8) Set boot up
8.1 Write startup scripts (linux Power on meeting Execute the files in this directory )
hold redis The installation directory utils Under the redis_init_script File copy to /etc/init.d/redis
cp /usr/local/redis/utils/redis_init_script /etc/init.d/redis
8.2 modify redis file
cd /etc/init.d
# Modify script execution permissions
chmod 777 redis
# edit redis file
vim /etc/init.d/redis
Specify your native binary file path and configuration file path
8.3 Test startup
/etc/init.d/redis start
8.4 Set up Redis Boot up
#centos
# Set boot up
systemctl enable redis.service
# Remove start
systemctl disable redis.service
#ubuntu
apt install sysv-rc-conf
# Set boot up
sysv-rc-conf redis on
# Remove start
sysv-rc-conf redis off
Docker install ( recommend )
1) start-up server
# install docker
yum install docker
docker run -d -p 6379:6379 --name redis01 redis
mount , if necessary
docker run -p 6379:6379 --name redis01 --restart=always -v /root/redis/redis.conf:/etc/redis/redis.conf -v /root/redis/data:/data -d redis redis-server /etc/redis/redis.conf
2) Start client
docker run -it --network host --rm redis redis-cli -h 127.0.0.1 -p 6379 --raw
边栏推荐
- Regular expression tutorial notes
- Leetcode sword finger offer 32 - I. print binary tree from top to bottom
- RESNET knowledge points supplement
- Machine learning notes: Elmo Bert
- redis分布式锁+线程池
- 高并发之使用RateLimiter、Semaphore对访问资源进行限流
- 详解IoU、GIoU、DIoU、CIoU、EIoU和DIoU-NMS
- 06.02 二叉树遍历
- BOM浏览器对象模型(上篇)——概述、window对象常见事件、JS执行机制(5秒后关闭广告、倒计时案例、发送短信倒计时案例)
- typora测试版过期无法正常使用
猜你喜欢
随机推荐
2022-07-18 至 2022-07-25 记录
Leetcode sword finger offer 26 Substructure of tree
Batch gradient descent, random gradient descent and mini batch gradient descent
Custom MVC add query
《教程》torchtext的应用
存储过程和for循环插入数据
Use ECs and OSS to set up personal network disk
647. 回文子串【双指针:两种对称情况-回文串】(字符串S中回文子串的个数)
From function to test open, Alibaba software testing experience, look at the technology stack of big manufacturers
*There are three common ways to obtain reflection: * class C = class Forname ("full class name with package name"); * class C = object. Getclass()/
DP knapsack problem
With the advent of 5g era, VR panoramic production is an industry worthy of entrepreneurship
Animation function encapsulation (slow motion animation)
机器学习之集成学习(Ensemble Learning)
Introduction to target detection (up to 2020)
简略break、continue、return的区别
Processes and threads
目标检测的类别损失和位置损失
Leetcode sword finger offer 32 - ii Print binary tree II from top to bottom
Solve gradient explosion and gradient disappearance