标签:tee utils fork 技术 复制 nload href image moni
centos7.8 安装 redis 6,先升级gcc,否则编译出错。
环境:
升级gcc:
yum -y install centos-release-scl yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile scl enable devtoolset-9 bash
安装主要按照redis.io官网说明进行安装:
# 下载源码包 wget https://download.redis.io/releases/redis-6.0.9.tar.gz tar xzf redis-6.0.9.tar.gz cd redis-6.0.9 # 编译安装到指定目录下 make PREFIX=/home/redis install # 复制配置文件到安装目录下 cp redis.conf /home/redis/bin/ # 创建客户端软连接 ln -s /home/redis/bin/redis-cli /usr/bin/redis
修改配置文件:
# 指定redis用守护线程的方式启动,后台运行 sed -i ‘s/daemonize no/daemonize yes/g‘ /home/redis/bin/redis.conf
配置开机启动:
sudo tee /etc/systemd/system/redis.service <<-‘EOF‘ [Unit] Description=redis-server After=network.target [Service] Type=forking ExecStart=/home/redis/bin/redis-server /home/redis/bin/redis.conf PrivateTmp=true [Install] WantedBy=multi-user.target EOF sudo systemctl daemon-reload sudo systemctl start redis.service sudo systemctl enable redis.service
测试一下:
[root@localhost bin]# redis 127.0.0.1:6379> ping PONG
标签:tee utils fork 技术 复制 nload href image moni
原文地址:https://www.cnblogs.com/luohaonan/p/14148117.html