tar -zvxf redis-5.0.2.tar.gz
3:將解壓出來(lái)的文件名修改為redis
4:由于redis是c語(yǔ)言編寫的,所以我們需要先安裝gcc,安裝的命令如下:yum -y install gcc
5:安裝成功后輸入 :gcc -v
查看版本
make
控制臺(tái)會(huì)輸出一些編譯的信息
7:編譯成功后,輸入:make install
自此redis就安裝成功了
8:輸入:redis-server 啟動(dòng)redis,啟動(dòng)成功。啟動(dòng)redis服務(wù):(三種啟動(dòng)方式)
1)前臺(tái)啟動(dòng):在任何目錄下執(zhí)行 redis-server
2)后臺(tái)啟動(dòng):在任何目錄下執(zhí)行 redis-server &
3)啟動(dòng)redis服務(wù)時(shí),指定配置文件:redis-server redis.conf & ,這種主要用于你改了配置文件的情況,比如你把默認(rèn)端口號(hào)改了,你就用這個(gè),正常也用這個(gè)
################################## SECURITY ###################################
# Require clients to issue AUTHbefore processing any other
# commands. This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
#
requirepass 123456
# Command renaming.
#
redis的客戶端,鏈接是redis-cli,有密碼的需要輸入auth 密碼,顯示OK才表示鏈接上,退出是exit[root@localhost redis]# redis-cli
127.0.0.1:6379>auth 123456
OK
127.0.0.1:6379>exit
[root@localhost redis]#
10:編寫sh啟動(dòng)腳本,保存為sh#/bin/bash
redis-server redis.conf &
10:編寫sh關(guān)閉腳本(通過(guò)密碼),保存為sh#/bin/bash
redis-cli -a 123456 shuntdown
11:設(shè)置redis開機(jī)自啟動(dòng)11-1:在/etc目錄下新建redis目錄
11-2:將/usr/local/redis/redis.conf文件復(fù)制一份到/etc/redis目錄下,并命名為6379.conf
11-3:將redis的啟動(dòng)腳本復(fù)制一份放到/etc/init.d目錄下
[root@localhost ~]# cp /opt/app/redis/utils/redis_init_script /etc/init.d/redisd
[root@localhost ~]#
11-4:設(shè)置redis開機(jī)自啟動(dòng), 先切換到/etc/init.d目錄下, 然后執(zhí)行自啟命令
[root@localhost ~]# cd /etc/init.d
[root@localhost init.d]# chkconfig redisd on
[root@localhost init.d]#
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧
分享文章:在linux安裝redis-創(chuàng)新互聯(lián)
鏈接地址:http://www.rwnh.cn/article44/poohe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、移動(dòng)網(wǎng)站建設(shè)、ChatGPT、企業(yè)網(wǎng)站制作、手機(jī)網(wǎng)站建設(shè)、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容