install redis on centos 8

 // You need tcl 8.5 or newer in order to run the Redis test
http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
		tar -zxvf tcl8.6.1-src.tar.gz 
		cd tcl8.6.1/
		cd unix/
		./configure
		make
		make install //安装成功 tcl
		
tar -xzvf redis-5.0.7.tar.gz 
yum install gcc
///yum install tcl //replace by new version. 
cd redis-5.0.7/
make MALLOC=libc  //          避免提示找不到 jemalloc/jemalloc.h
make test  //Test 安装成功 \o/ All tests passed without errors! 

 

 netstat -anp | grep 6379 //检查端口是否在使用中


firewall-cmd --add-port=6379/tcp --permanent  
firewall-cmd --reload   
firewall-cmd --list-ports

/tmp/redis-6.2.1/src/redis-server /tmp/redis-6.2.1/src/redis.conf

redis-cli -h 192.168.20.33 -p 6379 -a password 

# bind 127.0.0.1 
daemonize yes
protected-mode no 

//auto start 
cd /lib/systemd/system
vi redis.conf

[Unit]
Description=Redis
After=network.target

[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid  ###need
ExecStart=/usr/local/soft/redis6/redis-server ##### /usr/local/soft/redis6/redis.conf 
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

systemctl daemon-reload

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值