Story: I have two servers 122,123 and set up a tomcat cluster. Because the development environment is different from the official environment configuration, I need to leave a configuration file for the official environment on the official environment server, during the release, these reserved configuration files are used to overwrite the project configuration files that the two servers use, I don't want to maintain these reserved configuration files on both servers. On the 122 server, I created a webapps/backupConfig folder to share the configuration files with 123
Story:I have two servers.122,123,Set upTomcatCluster,Because the development environment is different from the official environment,I need to leave it on the official environment Server Configuration file of the official environment,Released,Use these reserved configuration files to overwrite them.
Because the project configuration files used by the two servers are the same,I don't want These reserved configuration files are maintained on both servers.
In122Of I have createdWebapps/backupConfigFolder,Let123Share
Operating System:Ubuntu, 122 (nfsServer), 123 (nfsClient)
TheIpAddress for reference only
Procedure:
1.122InstallNfs
Sudo apt-get install nfs-kernel-server
2.122SetWebapps/backupConfigFolder sharing
Sudo vim/etc/exports
Add
/Home/appuser/webapps/backupConfig 172.88.88.123(Rw, sync, no_root_squash)
Note:172.88.88.123Yes123 (nfsClient Server)
3.122Create a rebootNfsOfShell Restart-nfs.sh
#! /Bin/bash
# Echo "create by jinxin 2012-06-30"
Echo "restart nfs"
Sudo/etc/init. d/nfs-kernel-server restart
Sudo/etc/init. d/portmap restart
3.1SetShRun permission And run
Chmod + x *. sh
/Restart-nfs.sh
4.So far122 nfsThe server has been configured
123Client,InstallNfs-common
Sudo apt-get install nfs-commmon
5.123CreatedMount shellMount-backup-config.sh
#! /Bin/bash
# Echo "create by jinxin 2012-06-30"
Echo "mount-backup-config.sh"
Echo "mkdir-p webapps/backupConfig"
Mkdir-p webapps/backupConfig
Echo "sudo mount 172.88.88.122:/Home/appuser/webapps/backupConfig"
Sudo mount 172.88.88.122:/Home/appuser/webapps/backupConfig
5.1SetShRun permission And run
Chmod + x *. sh
./Mount-backup-config.sh
This completes the configuration.