国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > CentOS > 正文

在centos7上安裝redis的方法

2020-10-28 18:46:04
字體:
來源:轉載
供稿:網友

關閉防火墻:

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機啟動
firewall-cmd --state #查看默認防火墻狀態(關閉后顯示notrunning,開啟后顯示running)

配置編譯環境:

sudo yum install gcc-c++

下載源碼:

wget http://download.redis.io/releases/redis-3.2.8.tar.gz

解壓源碼:

tar -zxvf redis-3.2.8.tar.gz

進入到解壓目錄:

cd redis-3.2.8

執行make編譯Redis:

make MALLOC=libc

注意:make命令執行完成編譯后,會在src目錄下生成6個可執行文件,分別是redis-server、redis-cli、redis-benchmark、redis-check-aof、redis-check-rdb、redis-sentinel。

安裝Redis:

make install

配置Redis能隨系統啟動:

./utils/install_server.sh

顯示結果信息如下:

Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port           : 6379
Config file    : /etc/redis/6379.conf
Log file       : /var/log/redis_6379.log
Data dir       : /var/lib/redis/6379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!

Redis服務查看、開啟、關閉:

a.通過ps -ef|grep redis命令查看Redis進程

b.開啟Redis服務操作通過/etc/init.d/redis_6379 start命令,也可通過(service redis_6379 start)

c.關閉Redis服務操作通過/etc/init.d/redis_6379 stop命令,也可通過(service redis_6379 stop)

redis.conf 的配置信息

1、daemonize 如果需要在后臺運行,把該項改為yes

2、pidfile 配置多個pid的地址 默認在/var/run/redis.pid

3、bind 綁定ip,設置后只接受來自該ip的請求

4、port 監聽端口,默認是6379

5、loglevel 分為4個等級:debug verbose notice warning

6、logfile 用于配置log文件地址

7、databases 設置數據庫個數,默認使用的數據庫為0

8、save 設置redis進行數據庫鏡像的頻率。
9、rdbcompression 在進行鏡像備份時,是否進行壓縮

10、dbfilename 鏡像備份文件的文件名

11、Dir 數據庫鏡像備份的文件放置路徑

12、Slaveof 設置數據庫為其他數據庫的從數據庫

13、Masterauth 主數據庫連接需要的密碼驗證

14、Requriepass 設置 登陸時需要使用密碼

15、Maxclients 限制同時使用的客戶數量

16、Maxmemory 設置redis能夠使用的最大內存

17、Appendonly 開啟append only模式

18、Appendfsync 設置對appendonly.aof文件同步的頻率(對數據進行備份的第二種方式)

19、vm-enabled 是否開啟虛擬內存支持 (vm開頭的參數都是配置虛擬內存的)

20、vm-swap-file 設置虛擬內存的交換文件路徑

21、vm-max-memory 設置redis使用的最大物理內存大小

22、vm-page-size 設置虛擬內存的頁大小

23、vm-pages 設置交換文件的總的page數量

24、vm-max-threads 設置VM IO同時使用的線程數量

25、Glueoutputbuf 把小的輸出緩存存放在一起

26、hash-max-zipmap-entries 設置hash的臨界值

27、Activerehashing 重新hash

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乡宁县| 陵水| 友谊县| 阳泉市| 灵武市| 静乐县| 巴青县| 靖远县| 岑巩县| 台山市| 宜丰县| 五常市| 贞丰县| 克什克腾旗| 灵丘县| 张家界市| 邵阳市| 广宁县| 岐山县| 邯郸县| 合山市| 凤台县| 洮南市| 龙胜| 永顺县| 治多县| 芦山县| 瓦房店市| 仲巴县| 霍林郭勒市| 察隅县| 肃南| 洪洞县| 西乌珠穆沁旗| 正宁县| 阿克| 长子县| 武宣县| 交口县| 汝阳县| 林周县|