文件服务器高可用群集,集群部署 – 后台任务节点高可用 - Seafile 服务器用户手册...

配置keepalived服务

在每个seafile后端节点上安装和配置 keepalived 来实现浮动 IP 地址。

CentOS 7:

yum install keepalived -y

假设配置了两个seafile后台任务节点:background1、background2

在background1上修改 keepalived 配置文件(/etc/keepalived/keepalived.conf),写入如下内容:

! Configuration File for keepalived

global_defs {

notification_email {

root@localhost

}

notification_email_from keepalived@localhost

smtp_server 127.0.0.1

smtp_connect_timeout 30

router_id background1

vrrp_mcast_group4 224.0.100.18

}

vrrp_instance VI_1 {

state MASTER

interface eno16777736

virtual_router_id 52

priority 100

advert_int 1

authentication {

auth_type PASS

auth_pass hello123

}

virtual_ipaddress {

172.26.154.43/24 dev eno16777736

}

notify_master "/opt/seafile/seafile-server-latest/seafile-background-tasks.sh start"

notify_backup "/opt/seafile/seafile-server-latest/seafile-background-tasks.sh stop"

}

在background2上修改 keepalived 配置文件(/etc/keepalived/keepalived.conf),写入如下内容:

! Configuration File for keepalived

global_defs {

notification_email {

root@localhost

}

notification_email_from keepalived@localhost

smtp_server 127.0.0.1

smtp_connect_timeout 30

router_id background2

vrrp_mcast_group4 224.0.100.18

}

vrrp_instance VI_1 {

state BACKUP

interface eno16777736

virtual_router_id 52

priority 98

advert_int 1

authentication {

auth_type PASS

auth_pass hello123

}

virtual_ipaddress {

172.26.154.43/24 dev eno16777736

}

notify_master "/opt/seafile/seafile-server-latest/seafile-background-tasks.sh start"

notify_backup "/opt/seafile/seafile-server-latest/seafile-background-tasks.sh stop"

}

注意:以上配置中interface指定该节点的网卡设备名称,请根据实际情况配置。virtual_ipaddress 是后台服务的虚拟IP地址,也需要根据实际情况配置。

分别在两个后端节点上重启keepalived服务:

systemctl restart keepalived.service

重启成功后查看background1节点是否成功启用了相应的VIP。

修改seafile前端服务器相关配置

当配置好keepalived实现了虚拟IP漂移后,需要将seafile前端服务器里的相关配置指向后端服务器的虚拟IP。

在各seafile前端服务器节点上:

编辑seafevents.conf,修改以下配置信息:

[INDEX FILES]

...

es_host =

...

编辑seahub_settings.py,修改以下配置信息:

...

OFFICE_CONVERTOR_ROOT = 'http://'

...

注意:以上配置文件中的'vip'指的是keepalived服务上配置的虚拟IP地址。

重启前端节点上的seafile、seahub服务:

./seafile.sh restart

./seahub.sh restart # 如果你使用 fastcgi 请使用此命令`./seahub.sh restart-fastcgi`

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值