欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

CentOS6.564位下安裝Redis3.0.2的具體步驟

系統(tǒng)環(huán)境:CentOS 6.5 64位

成都創(chuàng)新互聯(lián)公司長(zhǎng)期為成百上千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對(duì)不同對(duì)象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺(tái),與合作伙伴共同營(yíng)造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為赤峰企業(yè)提供專業(yè)的成都做網(wǎng)站、成都網(wǎng)站制作,赤峰網(wǎng)站改版等技術(shù)服務(wù)。擁有10年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。

安裝方式:編譯安裝

防火墻:開啟

redis版本:Redis 3.0.2

一、環(huán)境準(zhǔn)備

1、安裝 gcc gcc-c++

[root@iZ94ebgv853Z ~]# yum install gcc gcc-c++ -y

2、下載redis-3.0.2.tar.gz

[root@iZ94ebgv853Z ~]# wget http://download.redis.io/releases/redis-3.0.2.tar.gz

二、安裝Redis

[root@iZ94ebgv853Z ~]# tar xf redis-3.0.2.tar.gz #解壓
[root@iZ94ebgv853Z ~]# cd redis-3.0.2
[root@iZ94ebgv853Z redis-3.0.2]# make
[root@iZ94ebgv853Z redis-3.0.2]# make test

報(bào)錯(cuò)如下:

cd src&& make test
make[1]:Entering directory `/root/redis-3.0.2/src'
You needtcl 8.5 or newer in order to run the Redis test
make[1]:*** [test] Error 1
make[1]:Leaving directory `/root/redis-3.0.2/src'
make: *** [test] Error 2

原因:需要安裝tcl

[root@iZ94ebgv853Zredis-3.0.2]# yum install tcl –y
[root@iZ94ebgv853Z redis-3.0.2]# make test
[root@iZ94ebgv853Zredis-3.0.2]# cp redis.conf /etc/ #復(fù)制配置文件

如果需自定義配置redis,可修改其配置文件/etc/redis.conf

三、在redis3.0.2文件夾下,安裝redis的最后一步

[root@localhost redis-3.0.2]# ls
[root@localhost redis-3.0.2]# cd src
[root@localhost src]# make install

四、啟動(dòng)redis

[root@iZ94ebgv853Z ~]# redis-server /etc/redis.conf

五、設(shè)置防火墻

######################################
# Firewall configuration written bysystem-config-firewall
# Manual customization of this file is notrecommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --stateESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp--dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-withicmp-host-prohibited
-A FORWARD -j REJECT --reject-withicmp-host-prohibited
COMMIT
#####################################

把文本框內(nèi)容寫入到/etc/sysconfig/iptables,覆蓋原來的內(nèi)容(如果有的話)。

[root@iZ94ebgv853Z ~]# service iptables start  #啟動(dòng)防火墻
[root@iZ94ebgv853Z ~]# iptables -I INPUT 1 -p tcp --dport6379 -j ACCEPT #開啟6379端口
[root@iZ94ebgv853Z ~]# service iptables save #保存防火墻的配置

六、設(shè)置開機(jī)啟動(dòng)

[root@iZ94ebgv853Z~]# chkconfig iptables on #設(shè)置iptables開機(jī)啟動(dòng)

設(shè)置redis開機(jī)啟動(dòng):

在/etc/rc.local中添加:/usr/local/bin/redis-server /etc/redis.conf > /dev/null &

(Linux的redis服務(wù)的開啟關(guān)閉

1.啟動(dòng):redis-server(redis-server redis.conf)

2.登陸:redis-cli(redis-cli -p 6379)

3.關(guān)閉:redis-cli shutdown

查看redis進(jìn)程:ps aux | grep redis

殺死進(jìn)程的方式:kill -9 PID )

七、redis密碼設(shè)置

首先關(guān)閉redis服務(wù),上面有;

然后去解壓后的redis-3.0.2中  查看當(dāng)前目錄:[root@localhost redis-3.0.2]# ls ;

 找到redis.conf配置文件,編輯redis.conf:        [root@localhost redis-3.0.2]# vim redis.conf

找到內(nèi)容#requirepass foobared   去掉注釋,foobared改為自己的密碼,我在這里改為:requirepass 123456

然后 保存  退出 重啟redis服務(wù)

(注意:由于redis中配置內(nèi)容多而雜,不容易找到注釋#requirepass foobared ,但
1、
注釋#requirepass foobared在
################################ LUA SCRIPTING  ###############################此注釋的下面第十三行處;
2、注釋#requirepass foobared在
################################ LIMITS ###############################此注釋的上面第二十行處;
3、redis-3.0.2此版本的redis.conf配置文件 共有937行內(nèi)容此#requirepass foobared注釋即在第391行

八、Jedis連接redis

java 代碼方式

//連接redis服務(wù)器,192.168.0.100:6379
 jedis = new Jedis("ip", 6379);
 //權(quán)限認(rèn)證
jedis.auth("password");

配置文件方式

<bean id=”jedisConnectionFactory”
class=”org.springframework.data.redis.connection.jedis.JedisConnectionFactory”>
<property name=”hostName” value=”${redis.host}” />
<property name=”port” value=”${redis.port}” />
<property name=”password” value=”${redis.pass}” />
</bean>

redis的其他命令。

如果需要關(guān)閉redis:
[root@iZ94jzcra1hZ bin]# pkill redis
如果需要開啟redis:
[root@iZ94jzcra1hZ bin]# redis-server &

加&符號(hào)的作用是為了讓此進(jìn)程轉(zhuǎn)換為后臺(tái)進(jìn)程,不占用shell的服務(wù)。

總結(jié)

以上所述是小編給大家介紹的CentOS 6.5 64位下安裝Redis3.0.2的具體步驟,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)創(chuàng)新互聯(lián)網(wǎng)站的支持!

新聞標(biāo)題:CentOS6.564位下安裝Redis3.0.2的具體步驟
鏈接URL:http://chinadenli.net/article10/gissdo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗(yàn)、建站公司、品牌網(wǎng)站設(shè)計(jì)搜索引擎優(yōu)化、網(wǎng)站策劃、面包屑導(dǎo)航

廣告

聲明:本網(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í)需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁(yè)設(shè)計(jì)