yum install gcc
創(chuàng)新互聯(lián)公司是網(wǎng)站建設(shè)技術(shù)企業(yè),為成都企業(yè)提供專業(yè)的成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站,網(wǎng)站設(shè)計(jì),網(wǎng)站制作,網(wǎng)站改版等技術(shù)服務(wù)。擁有十余年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制適合企業(yè)的網(wǎng)站。十余年品質(zhì),值得信賴!
wget http://download.redis.io/releases/redis-5.0.7.tar.gz
cp?redis-5.0.7.tar.gz? /usr/local
cd /usr/local
tar -zxvf?redis-5.0.7.tar.gz
cd redis-5.0.7
make
make? install?
cp /usr/local/redis-5.0.7/redis.conf? ?/usr/local/etc/
設(shè)置后臺(tái)啟動(dòng)
vi /usr/local/etc/redis.conf
????daemonize yes
設(shè)置redis服務(wù)器開機(jī)自動(dòng)啟動(dòng)
vi /lib/systemd/system/redis.service
[Unit]
Description=The redis-server Process Manager
Documentation=https://redis.io/
After=network.target
?
[Service]
Type=forking
ExecStart=/usr/local/bin/redis-server /usr/local/etc/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
PrivateTmp=true[Install]
WantedBy=multi-user.target
systemctl enable redis
systemctl start redis
systemctl status redis
redis-cli
127.0.0.1:6379>info server
這個(gè)是用戶啟動(dòng)項(xiàng),意思是只有這個(gè)用戶登陸的時(shí)候才啟動(dòng):
/usr/lib/systemd/system/
這個(gè)是系統(tǒng)開機(jī)啟動(dòng)項(xiàng),意思是開機(jī)就啟動(dòng),不管哪個(gè)用戶登錄:
/lib/systemd/system/
查看所有的開機(jī)啟動(dòng)項(xiàng):
systemctl list-unit-files |grep enabled