yum install cpp
yum install binutils
yum install glibc
yum install glibc-kernheaders
yum install glibc-common
yum install glibc-devel
yum install gcc
yum install make
yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
tar fx redis-6.0.10.tar.gz
cd redis-6.0.10
make
make install
cp src/redis-server /usr/local/bin/
cp src/redis-sentinel /usr/local/bin/
cp src/redis-cli /usr/local/bin/
cp src/redis-benchmark /usr/local/bin/
cp src/redis-check-rdb /usr/local/bin/
cp src/redis-check-aof /usr/local/bin/
cp redis.conf /etc/redis.conf
[root@proxy1 src]# mkdir -pv /etc/systemd/system/redis.service.d/
[root@proxy1 src]# cat >/etc/systemd/system/redis.service.d/limit.conf <<EOF
# If you need to change max open file limit
# for example, when you change maxclient in configuration
# you can change the LimitNOFILE value below
# see "man systemd.exec" for information
[Service]
LimitNOFILE=10240
EOF
cat > /usr/lib/systemd/system/redis.service <<EOF
[Unit]
Description=Redis persistent key-value database
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd
ExecStop=/usr/libexec/redis-shutdown
Type=notify
User=redis
Group=redis
RuntimeDirectory=redis
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl start redis
systemctl enable redis
版权声明:本文内容来自第三方投稿或授权转载,原文地址:https://blog.51cto.com/slapping/2596719,作者:类似简单,版权归原作者所有。本网站转在其作品的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如因作品内容、版权等问题需要同本网站联系,请发邮件至ctyunbbs@chinatelecom.cn沟通。