当前位置:网站首页>Redis set to start automatically at boot
Redis set to start automatically at boot
2022-08-08 04:54:00 【Small code helps you move forward】
Article table of contents
Foreword
It is more troublesome to start Redis every time you want to use Redis. We can directly set the startup to start automatically, so that we do not need to manually operate it every time.This article teaches you how to implement self-starting at boot by configuration.
I. What is Redis?
Redis is completely open source, complies with the BSD protocol, and is a high-performance key-value database.
Redis and other key-value caching products have the following three characteristics:
1. Redis supports data persistence, which can save data in memory on disk, and can be loaded again for use when restarting.
2. Redis not only supports simple key-value type data, but also provides storage of data structures such as list, set, zset, and hash.
3.Redis supports data backup, that is, data backup in master-slave mode.
Second, use steps
1. Create a new system service file
First enter the command: vi /etc/systemd/system/redis.service
After entering vim, paste the code below, and pay attention to check whether the address is the same.
After ExecStart is the installation location of your redis-server and the directory of the redis configuration file
[Unit]Description=redis-serverAfter=network.target[Service]Type=forkingExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/redis-6.2.6/redis.confPrivateTmp=true[Install]WantedBy=multi-user.target2. Reload system services
The command is as follows:
systemctl daemon-reload3. Start and view Redis
The command is as follows:
#Start Redissystemctl start redis#View Redis statussystemctl status redisYou can see that Redis is already running (running)

4. Stop Redis
The command is as follows:
systemctl stop redisYou can see that Redis is dead
5. Self-start at boot
After entering the command, Redis realizes the function of self-starting at boot. The command is as follows:
systemctl enable redisSummary
That's all for today
I am the editor of this article LXL
If you encounter a bug and need help,
Welcome to add wx:
xmzl1988
Note "csdn blog"
Warm reminder that this is a paid service;
边栏推荐
- 【直播回顾】昇思MindSpore易用性SIG2022上半年回顾总结
- postman---postman参数化
- Week 8 Generative Adversarial Networks(生成对抗网络 GAN)
- Error: [Intervention] Unable to preventDefault inside passive event listener due to target ...
- The 5 most mainstream project time management systems in China
- Open3D ICP精配准(使用鲁棒性核函数)
- BMS 产品功能和详细设计规格
- 中间件的一些坑记录
- B. Reverse Binary Strings
- 邮件钓鱼上线cobalstrike
猜你喜欢

ES6剩余参数的使用

类似Bugfree的9大在线缺陷管理软件

【直播回顾】昇思MindSpore易用性SIG2022上半年回顾总结

L3-006 Slash in the wind

NetCore使用Dapper查询数据

The 5 most mainstream project time management systems in China

awk语法-03-awk表达式(if语句、while循环、for循环)、awk中执行shell命令

wpf中DataGrid的样式

A line of code counts the number of occurrences of the specified string in the text

基于扰动观察法的光伏mppt最大功率控制matlab仿真
随机推荐
MySQL - Indexes and Transactions
Redis设置开机自启动
The research project of the Institute of Metal Research of the Chinese Academy of Sciences has been certified by Huawei, helping to develop a new paradigm in materials science!
C语言框架FreeSwitch自定义事件介绍与使用示例
C语言-函数
单主机docker 搭建 redis-cluster
Hard Disk Basics
C语言-分值和循环语句
【Redis】Redis学习——事务
亚马逊云科技Build On学习心得
【代码分析】图小样本异常检测方法:GDN:Few-shot Network Anomaly Detection via Cross-network Meta-learning
RecycleView配合Adapter调用notifyDataSetChanged闪屏?
【Template Engine】velocity
KD树应用汇总
[Code Analysis] Graph small sample anomaly detection method: GDN: Few-shot Network Anomaly Detection via Cross-network Meta-learning
The storage principle of NorFlash
Lecture 84 Biweekly t4 6144 and Lecture 305 t4 6138
MYSQL导出数据字典
32. Do you know how Redis strings are implemented?
BMS 产品功能和详细设计规格