• Welcome to The Network People Support Forums. Please login or sign up.
November 29, 2021, 08:03:26 PM

SSH and RSYNC

Started by Nick Cockinos, December 16, 2004, 06:23:48 PM

Previous topic - Next topic

Nick Cockinos

Hi Guys and Gals!

I followed the instructiosn and have my ns1 machine communiating with my ns2 machine via SSH. By that I mean that I can connect to ns2 from ns1 without needing a password.

In order for NicTool to send the updates from ns1 to ns2 (or more), do we have to have rsync running?

Do the data directories need to be identical?

There are significant differences between ns1 and ns2's directory structures. How does ns1 know where to trasnfer the updates to when it syncs with ns2?

Are there some step by step procedures for getting rsync performing correctly?

And (finally), what is the prefference? Rsync or SSH?

Thanks in advance.

Nick

Nick Cockinos

OK,
running rsync manually works a treat:

Quote:

rsync -avz -e ssh /home/tinydns/ns1.netunltd.com.au/data-ns1.netunltd.com.au/ mailto:tinydns@ns2.netunltd.com.au" target="_blank">tinydns@ns2.netunltd.com.au:/usr/local/tinydns-ns2.netunltd.com.au/root/


I get no errors, the data is transferred , but...
when I make a change in NicToolClient, I get "FAILED" in the export status field of the primary name server. Sad

Here's what I have in my ns1 config:

Data Directory:     /usr/local/tinydns-ns1.netunltd.com.au/data-ns1.netunltd.com .au/

Data is written to here without a problem. Then /home/tinydns/ns1.netunltd.com.au/data-ns1.netunltd.com.au/ is updated every 2 minutes. The transfer fails at this point. As mentioned earlier, I can manually run rsync/ssh without a problem, yet I can't see what or why NicTool can't do it.

Thanks in advance guys.

Nick

LogicX

confirm that it actually is failing (the filesize/md5/timestamp doesn't change in the /usr/local/tinydns-ns2.netunltd.com.au/root/ directory

view the home/tinydns/ns1.netunltd.com.au/log/main/current file and see if there are any good messages/errors
also try editing the nt_export*.pl file and set DEBUG options from 0 to 1

--- May this post be indexed by spiders, and archived for all to see as my internet epitaph.
http://FPuX.com" target="_blank">http://FPuX.com

Nick Cockinos

Now getting this in my log/main/current:

Quote:

@4000000041c27ef9321b3f64 No filehandle passed at /usr/local/tinydns-ns1.netunltd.com.au/nt_export_djb.pl line 43
@4000000041c684ac0547ebcc building data.cdb for ns1.netunltd.com.au
@4000000041c684ac06623184 ns1.netunltd.com.au: build_data: 1 build_cdb: 0 rsync_cdb:
@4000000041c685232d858e8c building data.cdb for ns1.netunltd.com.au
@4000000041c685232eb23f1c ns1.netunltd.com.au: build_data: 0 build_cdb: 0 rsync_cdb: 0
@4000000041c6859c1648374c building data.cdb for ns1.netunltd.com.au
@4000000041c6859c16f4174c ns1.netunltd.com.au: build_data: 0 build_cdb: 0 rsync_cdb: 0
@4000000041c686142c52ac0c building data.cdb for ns1.netunltd.com.au
@4000000041c686142d01f324 ns1.netunltd.com.au: build_data: 0 build_cdb: 0 rsync_cdb: 0
@4000000041c6868d34f82c4c building data.cdb for ns1.netunltd.com.au
@4000000041c6868d3748fa1c ns1.netunltd.com.au: build_data: 0 build_cdb: 0 rsync_cdb: 0
@4000000041c6870613430d9c building data.cdb for ns1.netunltd.com.au
@4000000041c6870613f2412c ns1.netunltd.com.au: build_data: 0 build_cdb: 0 rsync_cdb: 0
@4000000041c6877e295ce7c4 building data.cdb for ns1.netunltd.com.au
@4000000041c6877e2a09296c ns1.netunltd.com.au: build_data: 0 build_cdb: 0 rsync_cdb: 0



The first line ios probably telling everything I think. What filehandle is it reffering to?


Nick Cockinos

This is the output from both data directories /home/tinydns/ns1... and /usr/local/tinydns-ns1../data-ns1../

/home/tinydns/ns1.netunltd.com.au/data-ns1.netunltd.com.au/:
total 30
drwxr-xr-x  2 tinydns  tinydns   512 Dec 20 16:08 .
drwxr-xr-x  7 tinydns  tinydns   512 Dec 17 14:27 ..
-rw-r--r--  1 tinydns  tinydns  4753 Dec 20 16:08 data
-rw-r--r--  1 tinydns  tinydns  9084 Dec 20 16:08 data.cdb
-rw-r--r--  1 tinydns  tinydns    32 Dec 20 16:08 data.md5
-rw-r--r--  1 tinydns  tinydns  4753 Dec 20 16:06 data.orig
-rw-r--r--  1 tinydns  tinydns    32 Dec 20 16:08 data.orig.md5

/usr/local/tinydns-ns1.netunltd.com.au/data-ns1.netunltd.com .au/:
total 30
drwxr-xr-x  2 tinydns  tinydns   512 Dec 20 16:08 .
drwxr-sr-t  8 tinydns  tinydns   512 Dec 17 14:38 ..
-rw-r--r--  1 tinydns  tinydns  4753 Dec 20 16:08 data
-rw-r--r--  1 tinydns  tinydns  9084 Dec 20 16:08 data.cdb
-rw-r--r--  1 tinydns  tinydns    32 Dec 20 16:08 data.md5
-rw-r--r--  1 tinydns  tinydns  4753 Dec 20 16:06 data.orig
-rw-r--r--  1 tinydns  tinydns    32 Dec 20 16:08 data.orig.md5

Identical...

LogicX

they should not be identical.

Not sure what you're running thats writing to   /usr/local/tinydns-ns1.netunltd.com.au/data-ns1.netunltd.com .au/
directly, but there should only be one file copying into   /usr/local/tinydns-ns1.netunltd.com.au/data-ns1.netunltd.com .au/ which is data.cdb


The error log first line is to be ignored, as i mentioned in my synopsis.

The 2nd line's lack of a value for the rsync would further explain why things are failing.

First fix whatever is wrongly writing directly into the tinydns path.
--- May this post be indexed by spiders, and archived for all to see as my internet epitaph.
http://FPuX.com" target="_blank">http://FPuX.com

Nick Cockinos

Quote:

Not sure what you're running thats writing to  /usr/local/tinydns-ns1.netunltd.com.au/data-ns1.netunltd.com .au/
directly, but there should only be one file copying into  /usr/local/tinydns-ns1.netunltd.com.au/data-ns1.netunltd.com .au/ which is data.cdb



I guess it comes from here:
Quote:

Now if you symlink that into the service directory:
ln -s /home/tinydns/ns4.domain.com /service/

it should start up, and begin by creating and populating
/home/tinydns/ns4.domain.com/data-ns4.domain.com



LogicX

nickcockinos wrote on Mon, 20 December 2004 05:07

Quote:

Not sure what you're running thats writing to   /usr/local/tinydns-ns1.netunltd.com.au/data-ns1.netunltd.com .au/
directly, but there should only be one file copying into   /usr/local/tinydns-ns1.netunltd.com.au/data-ns1.netunltd.com .au/ which is data.cdb



I guess it comes from here:
Quote:

Now if you symlink that into the service directory:
ln -s /home/tinydns/ns4.domain.com /service/

it should start up, and begin by creating and populating
/home/tinydns/ns4.domain.com/data-ns4.domain.com






Correct.  When running the nt_export_djb from /home/tinydns/ns4.domain.com, it'll populate /home/tinydns/ns4.domain.com/data-ns4.domain.com, and then rsync /home/tinydns/ns4.domain.com/data-ns4.domain.com/data.cdb to mailto:tinydns@ns4.domain.com" target="_blank">tinydns@ns4.domain.com:/usr/local/tinydns-ns4.domain.com/root/ (or whatever path you specify in the nictool config for the nameserver)

therefore /usr/local/tinydns-ns4.domain.com (the tinydns server that responds to UDP DNS requests) only gets its data.cdb file from the rsync from nt_export_djb, and nothing else writes directly to /usr/local/tinydns-ns4.domain.com/root
--- May this post be indexed by spiders, and archived for all to see as my internet epitaph.
http://FPuX.com" target="_blank">http://FPuX.com