Installation and Setup of 'rsync' |
PGCluster is using 'rsync' for the data synchronization with Master DB
at the time of the addition of Cluster DB, or restoration.
Therefore, the 'rsync' is required in order to use pgcluster.
The 'rsync' is a command for copying files among servers as well as the 'rcp'
command.
The good points of rsync are the ability to be able to choose the file for a copy
by the difference during a file, or shorten transfer time by compression of transmit
data.
The 'rsync' can prevent a leak of information by a data encryption, or can attest
a user safely using RSA authentication.
The 'rsync' excels 'rcp' in the security side. 'rsync' prevents a leak of information
by a communication data encryption, or can be safely attested by using RSA authentication.
When you use distribution packages, such as Red Hat Linux, since you can install
rsync with package management commands (rpm etc.), you are not troubled by the
installation itself. When you install with a tool (like rpm), please have a look
from the chapter of a setup.
1.Download |
When you compile rsync from source code, the following four software is required.
Since the security hole is found in zlib or openssl, you should update them
to the latest version.
1.1 zlib |
1.2 openssl |
1.3 openssh |
1.4 rsync |
2.Compile and installation |
2.1 zlib |
| # cd /usr/local/src # tar -zxvf /tmp/zlib-1.1.4.tar.gz # cd zlib-1.1.4 # ./configure --prefix=/usr --shared # make # make install |
2.2 openssl |
| # cd /usr/local/src # tar -zxvf /tmp/openssl-0.9.6g.tar.gz # cd openssl-0.9.6g # ./config --prefix=/usr shared # make # makeinstall |
2.3 openssh |
| # mkdir /etc/ssh # mkdir /var/empty # chown root.sys /var/empty # chmod 755 /var/empty # groupadd sshd # useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd # cd /usr/local/src # tar -zxvf /tmp/openssh-3.5p1.tar.gz # cd openssh-3.5p1 # LIBS=-lcrypt ./configure --prefix=/usr --sysconfdir=/etc/ssh # make # make install |
2.4 rsync |
| # cd /usr/local/src # tar -zxvf /tmp/rsync-2.5.5.tar.gz # cd rsync-2.5.5 # ./configure # make # make install |
3. Setup |
3.1 openssh |
| # su -l postgres $ ssh-keygen -t rsa1 $ cd .ssh $ cp identity.pub authorized_keys |
| RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys #RhostsRSAAuthentication no #PasswordAuthentication yes |
| (The public key to add shall be put on ".ssh/client.pub" by
FTPj $ cd .ssh $ cat client.pub >> authorized_keys |
| # cp /usr/local/src/openssh-3.5p1/contrib/redhat/sshd.init /etc/rc.d/init.d/sshd |
4. Test |
| # su -l postgres $ rsync -auzr -e "ssh -1" master:/usr/local/pgsql/data /usr/local/pgsql |
| [Fromat] --------------------------------------------------------------------------- @@rsync [OPTION]... [[USER@]HOST:]SRC DEST --------------------------------------------------------------------------- [Options] --------------------------------------------------------------------------- SRC --- The file or directory of the source of transmission . DEST--- The file or directory of the transmission destination . -a (archive) --- Transmits with the file information on original. -u (update) --- When the file of the copy destination is newer, it does not update. -z (compress with zlib ) --- transmits with compression. -r (recursive) --- Transmits the file in a directory recursively. -e --- Specifies the command used at the time of a file transfer. ("ssh-1" specified in the example means using SSH using RSA1 for a protocol at the time of a file transfer. ) |