CentOS7.5 yum和手动安装redis并设置开机启动
2019-08-01 08:52
288 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/woohore/article/details/98026076
CentOS7.5 yum 安装redis并设置开机启动
- 安装EPEL源
yum install epel-release - 安装redis
yum install redis - 设置redis开机启动
systemctl enable redis.service - 设置redis密码并开通局域网访问
打开/etc/redis.conf,找到其中的# requirepass foobared
,去掉前面的#并把foobared改成你的密码,或者直接新起一行写自己的密码。
按redis.conf中的说明,默认会把访问IP设定为127.0.0.1本机并打开保护模式,所以需要把bind 127.0.0.1
这一行加#注释掉,以允许除本机外的其他用户用密码连接。
redis.conf文件默认在/etc目录下,允许更改位置和名字,更改后在/usr/lib/systemd/system/redis.service中,把ExecStart=/usr/bin/redis-server /etc/redis/6379.conf --daemonize no
中的redis.conf的路径改成的新的路径。
手动安装后创建Redis服务
- 创建服务文件
sudo vi /usr/lib/systemd/system/redis.service - 文件内容如下
[Unit] Description=Redis Server After=network.target [Service] ExecStart=/usr/redis/redis-4.0.2/src/redis-server /usr/redis/redis-4.0.2/redis.conf --daemonize no ExecStop=/usr/redis/redis-4.0.2/src/redis-cli -p 6379 shutdown Restart=always [Install] WantedBy=multi-user.target
- 设置Redis服务开机启动
sudo systemctl enable redis - 启动Redis服务
sudo systemctl start redis
相关文章推荐
- centos6.5使用yum安装redis 设置开机启动
- Centos 7安装及设置redis自定义服务开机启动
- CentOS 7编译安装nginx/redis设置开机启动
- Centos 6.X 安装Redis 并设置开机启动
- Ubuntu与Centos安装redis教程,及其设置开机自动启动
- CenterOS 中安装Redis及开机启动设置详解
- Windows下安装Redis并设置开机自动启动
- CentOS6.8下安装redis并配置开机自启动
- Centos设置Redis开机启动
- windows下安装配置redis 并设置为开机启动
- Nginx设置成服务并开机自动启动【yum安装的成功了】
- centOS7 安装 redis 并设置开机启动
- centos7 安装redis并开机启动
- windows下安装配置redis 并设置为开机启动
- Linux上安装ZooKeeper并设置开机启动(CentOS7+ZooKeeper3.4.10)
- centos6.5 redis3 开机自动启动命令设置
- Windows安装Redis并设置为开机启动
- Centos下mysql数据库安装、创建数据库、utf8编码设置、外部访问授权、导入sql执行、开机启动(系列1)
- ubuntu手动安装redmine并且设置成为开机启动
- linux【centos 】 安装tomcat并设置成开机启动