Ubuntu 22.04.3 LTS 设置 Redis 开机自启动

  1. 编译安装
  2. 创建自启动服务
bash 复制代码
sudo vim /etc/systemd/system/redis.service

内容如下:

bash 复制代码
[Unit]
Description=redis-server
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/bin/redis-server /home/xwx/redis/redis.conf
PrivateTmp=true

[Install]
WantedBy=multi-user.target
  1. 使启动生效
bash 复制代码
sudo systemctl enable redis

会在 /etc/systemd/system/multi-user.target.wants/ 下面生成一个 redis.service 的符号链接,这样开机自启动才会生效

相关推荐
Mr__Miss16 分钟前
Redis网络模型
数据库·redis·面试
初听于你19 分钟前
IP地址与路由器地址
linux·运维·服务器·网络·tcp/ip·计算机网络·智能路由器
亲爱的非洲野猪21 分钟前
Apigee Hybrid 数据存储架构详解:Redis与数据库的精确分工
数据库·redis·架构
不想写bug呀24 分钟前
Redis基础知识及五种类型操作
数据库·redis·缓存
s_daqing34 分钟前
ubuntu(arm)使用nginx安装静态服务器
服务器·nginx·ubuntu
FJW02081440 分钟前
【Linux】SElinux的管理及优化
linux·运维·服务器
坐怀不乱杯魂1 小时前
Linux - 进程控制
linux·运维·服务器
重生之绝世牛码1 小时前
Linux软件安装 —— zookeeper集群安装
大数据·linux·运维·服务器·zookeeper·软件安装
额1291 小时前
磁盘物理卷、卷组、逻辑卷管理
linux·运维·服务器
Maggie_ssss_supp1 小时前
Linux-正则表达式
linux·运维·正则表达式