更新时间:2024-04-23 GMT+08:00
节点服务器挂载Nas存储
主节点挂载Nas(从节点同)
- 背景
主从节点同步和通信需要使用到共享存储
- 解决思路
在需要共享节点挂载共享文件到对于目录(xxx.xxx.xxx.xxx为SFS服务器地址)
yum install nfs-utils mount -t nfs -o vers=3,nolock xxx.xxx.xxx.xxx:/ /data
- 设置软连接(主从均配置)
- 将ecology以下目录复制到/data目录下(从节点不做)
album formmode mobilemode mobile email filesystem images images_face images_frame LoginTemplateFile messager m_img others page upgrade wui mkdir /usr/weaver/ecology/LoginTemplateFile(从做) mkdir /usr/weaver/ecology/others(从做) cp -r /usr/weaver/ecology/album /data cp -r /usr/weaver/ecology/formmode /data cp -r /usr/weaver/ecology/mobilemode /data cp -r /usr/weaver/ecology/mobile /data cp -r /usr/weaver/ecology/email /data cp -r /usr/weaver/ecology/filesystem /data cp -r /usr/weaver/ecology/images /data cp -r /usr/weaver/ecology/images_face /data cp -r /usr/weaver/ecology/images_frame /data cp -r /usr/weaver/ecology/LoginTemplateFile /data cp -r /usr/weaver/ecology/messager /data cp -r /usr/weaver/ecology/m_img /data cp -r /usr/weaver/ecology/others /data cp -r /usr/weaver/ecology/page /data cp -r /usr/weaver/ecology/upgrade /data cp -r /usr/weaver/ecology/wui /data
- 将ecology\WEB-INF下(从节点不做)
mkdir –p /usr/weaver/ecology/WEB-INF/lib/keys cp -r /usr/weaver/ecology/WEB-INF/securityRule/ /data cp -r /usr/weaver/ecology/WEB-INF/securityXML/ /data cp -r /usr/weaver/ecology/WEB-INF/service /data cp -r /usr/weaver/ecology/WEB-INF/lib/keys /data cp -r /usr/weaver/ecology/WEB-INF/weaver_security_rules.xml /data cp -r /usr/weaver/ecology/WEB-INF/weaver_security_config.xml /data cp -r /usr/weaver/ecology/WEB-INF/hrmsettings.xml /data
复制到/data目录下
- 备份(主从做)
cd /usr/weaver/ecology/ mv album album.bak mv images images.bak mv images_face images_face.bak mv formmode formmode.bak mv mobile mobile.bak mv mobilemode mobilemode.bak mv images_frame images_frame.bak mv LoginTemplateFile LoginTemplateFile.bak mv m_img m_img.bak mv filesystem filesystem.bak mv page page.bak mv messager messager.bak mv email email.bak mv wui wui.bak mv others others.bak mv upgrade upgrade.bak cd /usr/weaver/ecology/WEB-INF mv service service.bak mv lib/keys lib/keys.bak mv securityRule securityRule.bak mv securityXML securityXML.bak mv weaver_security_config.xml weaver_security_config.xml.bak mv weaver_security_rules.xml weaver_security_rules.xml.bak mv hrmsettings.xml hrmsettings.xml.blk
- 建立共享文件夹的软链接:(主从做)
ln -sf /data/album /usr/weaver/ecology/album ln -sf /data/filesystem /usr/weaver/ecology/filesystem ln -sf /data/images /usr/weaver/ecology/images ln -sf /data/images_face /usr/weaver/ecology/images_face ln -sf /data/images_frame /usr/weaver/ecology/images_frame ln -sf /data/LoginTemplateFile /usr/weaver/ecology/LoginTemplateFile ln -sf /data/messager /usr/weaver/ecology/messager ln -sf /data/m_img /usr/weaver/ecology/m_img ln -sf /data/page /usr/weaver/ecology/page ln -sf /data/wui /usr/weaver/ecology/wui ln -sf /data/email /usr/weaver/ecology/email ln -sf /data/others /usr/weaver/ecology/others ln -sf /data/service /usr/weaver/ecology/WEB-INF/service ln -sf /data/securityRule /usr/weaver/ecology/WEB-INF/securityRule ln -sf /data/securityXML /usr/weaver/ecology/WEB-INF/securityXML ln -sf /data/hrmsettings.xml /usr/weaver/ecology/WEB-INF/hrmsettings.xml ln -sf /data/weaver_security_rules.xml /usr/weaver/ecology/WEB-INF/weaver_security_rules.xml ln -sf /data/weaver_security_config.xml /usr/weaver/ecology/WEB-INF/weaver_security_config.xml ln -sf /data/keys /usr/weaver/ecology/WEB-INF/lib/keys ln -sf /data/formmode /usr/weaver/ecology/formmode ln -sf /data/mobilemode /usr/weaver/ecology/mobilemode ln -sf /data/mobile /usr/weaver/ecology/mobile ln -sf /data/upgrade /usr/weaver/ecology/upgrade
- 在需要共享节点随机启动时,挂载共享文件(注意空隙使用tab)
vi /etc/fstab xxx.xxx.xxx.xxx:/ /data nfs defaults 0 0
- 将ecology以下目录复制到/data目录下(从节点不做)
父主题: 搭建ecology运行环境