标签:art use ble start pre inf ln -s down 开机
参考:
https://www.cnblogs.com/heqiuyong/p/10463334.html
1.切换到root用户
2.切换目录到/usr/local
3.安装gcc依赖
由于 redis 是用 C 语言开发,安装之前必先确认是否安装 gcc 环境(gcc -v),如果没有安装,执行以下命令进行安装
yum install -y gcc
4.下载并解压
wget http://download.redis.io/releases/redis-5.0.3.tar.gz
tar -zxvf redis-5.0.3.tar.gz
5.cd切换到redis解压目录下,执行编译
cd redis-5.0.3
make
6.安装并指定安装目录
make install PREFIX=/usr/local/redis
7.前台启动
cd /usr/local/redis/bin/
./redis-server
8.后台启动
从 redis 的源码目录中复制 redis.conf 到 redis 的安装目录: cp /usr/local/redis-5.0.3/redis.conf /usr/local/redis/bin/
修改 redis.conf 文件,把 daemonize no 改为 daemonize yes
vi redis.conf
后台启动
./redis-server redis.conf
9.设置开机启动
vi /etc/systemd/system/redis.service
粘贴以下内容,ExecStart设置为自己的目录
[Unit] Description=redis-server After=network.target [Service] Type=forking ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf PrivateTmp=true [Install] WantedBy=multi-user.target
设置开机启动
systemctl daemon-reload
systemctl start redis.service
systemctl enable redis.service
创建软连接:ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis
测试
标签:art use ble start pre inf ln -s down 开机
原文地址:https://www.cnblogs.com/Baronboy/p/12235462.html