Redis集群 單機多埠的配置方式

2021-10-11 21:28:09 字數 1066 閱讀 8827

一、前提

二、配置流程

2.1 新建乙個資料夾存放集群配置檔案

mkdir redis-cluster

cd redis-cluster/

mkdir 6379 6380 6381 6382 6383 6384

2.2 在上述6個新資料夾中建立conf和data資料夾(可以使用指令碼批量建立)
cd 6379

mkdir conf

mkdir data

2.3 在每個conf資料夾下建立乙個redis.conf檔案(可以將redis的redis.conf複製乙份,在此基礎上進行修改;也可以直接新建乙個空檔案,將需要的配置寫出來)

我是新建了乙個redis.conf空檔案,如下所示

port 6379

protected-mode no

daemonize no

bind 0.0.0.0

cluster-enabled yes

cluster-node-timeout 5000

cluster-config-file nodes.conf

cluster-announce-ip 172.24.83.165

cluster-announce-port 6379

cluster-announce-bus-port 16379

2.4 啟動所有redis server
/users/***/downloads/安裝包/redis-5.0.5/src/redis-server ./redis-cluster/6379/conf/redis.conf
2.5 進入某乙個redis客戶端,並執行建立集群命令
redis-cli -p 6379 --cluster create  172.24.83.165:6379  172.24.83.165:6380 172.24.83.165:6381 172.24.83.165:6382 172.24.83.165:6383 172.24.83.165:6384 --cluster-replicas 1

Apache多埠配置

virtual hosts include conf extratpd vhosts.conf開啟 virtual hosts include conf extratpd vhosts.conf開啟extratpd vhosts.conf 新增 配置 serveradmin webmaster du...

wampserver 多埠配置

apache 的配置檔案httpd.conf 檔案裡 開啟 include conf extra httpd vhosts.conf 然後開啟 include conf extra httpd vhosts.conf檔案 配置如下 以81埠為例 listen 81 documentroot e jy...

Apache配置多埠

1 修改apache conf httpd.config檔案,增加listen 2 修改apache conf httpd.config檔案,增加servername 3 修改apache conf httpd.config檔案,開啟虛擬主機 4 修改apache conf extra httpd ...