DANTE Alexandra Alexandra.Dante
Tue Oct 17 04:34:03 PDT 2006
Hello Andrew, hello List,

I made several tests this morning to understand perfectly the slon 
processes taking into account what you tell me but I still have questions.
On the master server, for which the IP address is 1.2.3.4, I launched 
this morning the "slon_start node1" command and with the "ps" command, I 
saw :
-bash-3.00$ slon_start node1
Invoke slon for node 1 - /usr/bin//slon -s 1000 -d2 replication 
'host=1.2.3.4 dbname=cave user=slony port=5432' 2>&1 > 
/SLONY_PGS/log/slony1/slony1/node1/cave-2006-10-17_08:55:21.log &
Slon successfully started for cluster replication, node node1
PID [21865]
Start the watchdog process as well...

-bash-3.00$ ps -ef | grep post
postgres 14872     1  0 08:50 pts/1    00:00:00 /usr/bin/postmaster
postgres 14873 14872  0 08:50 pts/1    00:00:00 postgres: logger process  
postgres 14895 14872  0 08:50 pts/1    00:00:00 postgres: writer process  
postgres 14896 14872  0 08:50 pts/1    00:00:00 postgres: stats buffer 
process  
postgres 14897 14896  0 08:50 pts/1    00:00:00 postgres: stats 
collector process  
postgres 21865     1  0 08:55 pts/1    00:00:00 /usr/bin//slon -s 1000 
-d2 replication host=1.2.3.4 dbname=cave user=slony port=5432
postgres 21875     1  1 08:55 pts/1    00:00:00 /usr/bin/perl 
/usr/local/slony/bin/slon_watchdog 
--config=/usr/local/slony/etc/slon_tools.conf node1 30
postgres 21876 21865  0 08:55 pts/1    00:00:00 /usr/bin//slon -s 1000 
-d2 replication host=1.2.3.4 dbname=cave user=slony port=5432
postgres 21879 14872  0 08:55 pts/1    00:00:00 postgres: slony cave 
1.2.3.4(35829) idle
postgres 21884 14872  0 08:55 pts/1    00:00:00 postgres: slony cave 
1.2.3.4(35830) idle
postgres 21885 14872  0 08:55 pts/1    00:00:00 postgres: slony cave 
1.2.3.4(35831) idle
postgres 21886 14872  0 08:55 pts/1    00:00:00 postgres: slony cave 
1.2.3.4(35832) idle

=> I still don't understand why I see all these connections on the 
database "cave"...
=> Could you explain me this point please ?


Then, I checked my configuration with :
-bash-3.00$ show_configuration
Slony Configuration
-------------------------------------

Slony-I Cluster: replication
Logs stored under /SLONY_PGS/log/slony1
Slony Binaries in: /usr/bin/

Node information
--------------------------------
Node:  1 Host:     1.2.3.4 User:    slony Port: 5432 Forwarding?      
Parent:  0 Database:       cave
         DSN: host=1.2.3.4 dbname=cave user=slony port=5432
Node:  2 Host:     5.6.7.8 User:    slony Port: 5432 Forwarding?      
Parent:  0 Database:       cave
         DSN: host=5.6.7.8 dbname=cave user=slony port=5432


By launching the "slon_start" command on the master node, I saw that in 
the slave node a connection on the database "cave" used in the 
replication from the master node :
[postgres at slave ~]$ ps -ef | grep post
postgres 22970     1  0 Oct12 ?        00:00:00 
/opt/postgre/V813/bin/postmaster
postgres 22998 22970  0 Oct12 ?        00:00:00 postgres: writer 
process       
postgres 22999 22970  0 Oct12 ?        00:00:00 postgres: stats buffer 
process  
postgres 23000 22999  0 Oct12 ?        00:00:00 postgres: stats 
collector process  
postgres 21011 22970  0 08:55 ?        00:00:00 postgres: slony cave 
1.2.3.4(35833) idle

Until this point, I can understand that on the slave node, I have a 
connection from the master node.
But, when I launched the same command "slon_start" on the slave node, I 
had :
[postgres at slave ~]$ ps -ef | grep post
postgres 22970     1  0 Oct12 ?        00:00:00 
/opt/postgre/V813/bin/postmaster
postgres 22998 22970  0 Oct12 ?        00:00:00 postgres: writer 
process       
postgres 22999 22970  0 Oct12 ?        00:00:00 postgres: stats buffer 
process  
postgres 23000 22999  0 Oct12 ?        00:00:00 postgres: stats 
collector process  
postgres 21011 22970  0 08:55 ?        00:00:00 postgres: slony cave 
1.2.3.4(35833) idle
root     30310 23871  0 09:01 pts/1    00:00:00 su - postgres
postgres 30312 30310  0 09:01 pts/1    00:00:00 -bash
postgres 32645     1  0 09:02 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32654     1  0 09:02 pts/1    00:00:00 /usr/bin/perl 
/usr/local/slony/bin/slon_watchdog 
--config=/usr/local/slony/etc/slon_tools.conf node2 30
postgres 32689 32645  0 09:02 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32692 22970  0 09:02 ?        00:00:00 postgres: slony cave 
5.6.7.8(35715) idle
postgres 32699 22970  0 09:02 ?        00:00:00 postgres: slony cave 
5.6.7.8(35716) idle
postgres 32700 22970  0 09:02 ?        00:00:00 postgres: slony cave 
5.6.7.8(35718) idle
postgres 32701 22970  0 09:02 ?        00:00:00 postgres: slony cave 
5.6.7.8(35719) idle

=> It is the same problem that I have on the master node, I don't 
understand all the connections on the database "cave"...

[postgres at bt3 ~]$ show_configuration
Slony Configuration
-------------------------------------

Slony-I Cluster: replication
Logs stored under /SLONY_PGS/log/slony1
Slony Binaries in: /opt/postgre/V813/bin/

Node information
--------------------------------
Node:  1 Host:     1.2.3.4 User:    slony Port: 5432 Forwarding?      
Parent:  0 Database:       cave
         DSN: host=1.2.3.4 dbname=cave user=slony port=5432
Node:  2 Host:     5.6.7.8 User:    slony Port: 5432 Forwarding?      
Parent:  0 Database:       cave
         DSN: host=5.6.7.8 dbname=cave user=slony port=5432

To be sure, I launched the commands "ps -eLf | grep post", "ps axm | 
grep post", "netstat | grep post" on the master and slave nodes, but I 
didn't find a good answer...
This is the results of these commands on the MASTER node :
-bash-3.00$ ps -eLf | grep post
postgres 14872     1 14872  0    1 08:50 pts/1    00:00:00 
/usr/bin/postmaster
postgres 14873 14872 14873  0    1 08:50 pts/1    00:00:00 postgres: 
logger process  
postgres 14895 14872 14895  0    1 08:50 pts/1    00:00:00 postgres: 
writer process  
postgres 14896 14872 14896  0    1 08:50 pts/1    00:00:00 postgres: 
stats buffer process  
postgres 14897 14896 14897  0    1 08:50 pts/1    00:00:00 postgres: 
stats collector process  
postgres 21865     1 21865  0    1 08:55 pts/1    00:00:00 
/usr/bin//slon -s 1000 -d2 replication host=1.2.3.4 dbname=cave 
user=slony port=5432
postgres 21875     1 21875  0    1 08:55 pts/1    00:00:00 /usr/bin/perl 
/usr/local/slony/bin/slon_watchdog 
--config=/usr/local/slony/etc/slon_tools.conf node1 30
postgres 21876 21865 21876  0    7 08:55 pts/1    00:00:00 
/usr/bin//slon -s 1000 -d2 replication host=1.2.3.4 dbname=cave 
user=slony port=5432
postgres 21876 21865 21877  0    7 08:55 pts/1    00:00:00 
/usr/bin//slon -s 1000 -d2 replication host=1.2.3.4 dbname=cave 
user=slony port=5432
postgres 21876 21865 21878  0    7 08:55 pts/1    00:00:00 
/usr/bin//slon -s 1000 -d2 replication host=1.2.3.4 dbname=cave 
user=slony port=5432
postgres 21876 21865 21880  0    7 08:55 pts/1    00:00:00 
/usr/bin//slon -s 1000 -d2 replication host=1.2.3.4 dbname=cave 
user=slony port=5432
postgres 21876 21865 21881  0    7 08:55 pts/1    00:00:00 
/usr/bin//slon -s 1000 -d2 replication host=1.2.3.4 dbname=cave 
user=slony port=5432
postgres 21876 21865 21882  0    7 08:55 pts/1    00:00:00 
/usr/bin//slon -s 1000 -d2 replication host=1.2.3.4 dbname=cave 
user=slony port=5432
postgres 21876 21865 21883  0    7 08:55 pts/1    00:00:00 
/usr/bin//slon -s 1000 -d2 replication host=1.2.3.4 dbname=cave 
user=slony port=5432
postgres 21879 14872 21879  0    1 08:55 pts/1    00:00:02 postgres: 
slony cave 1.2.3.4(35829) idle
postgres 21884 14872 21884  0    1 08:55 pts/1    00:00:00 postgres: 
slony cave 1.2.3.4(35830) idle
postgres 21885 14872 21885  0    1 08:55 pts/1    00:00:01 postgres: 
slony cave 1.2.3.4(35831) idle
postgres 21886 14872 21886  0    1 08:55 pts/1    00:00:04 postgres: 
slony cave 1.2.3.4(35832) idle
postgres  1182 14872  1182  0    1 09:02 pts/1    00:00:04 postgres: 
slony cave 5.6.7.8(35717) idle

-bash-3.00$ ps axm | grep post
14872 pts/1    -      0:00 /usr/bin/postmaster
14873 pts/1    -      0:00 postgres: logger process  
14895 pts/1    -      0:00 postgres: writer process  
14896 pts/1    -      0:00 postgres: stats buffer process  
14897 pts/1    -      0:00 postgres: stats collector process  
21879 pts/1    -      0:02 postgres: slony cave 1.2.3.4(35829) idle
21884 pts/1    -      0:00 postgres: slony cave 1.2.3.4(35830) idle
21885 pts/1    -      0:01 postgres: slony cave 1.2.3.4(35831) idle
21886 pts/1    -      0:04 postgres: slony cave 1.2.3.4(35832) idle
 1182 pts/1    -      0:04 postgres: slony cave 5.6.7.8(35717) idle

-bash-3.00$ netstat | grep post
tcp        0      0 bt1.frec.bull.fr:35830      
bt1.frec.bull.fr:postgres   ESTABLISHED
tcp        0      0 bt1.frec.bull.fr:35831      
bt1.frec.bull.fr:postgres   ESTABLISHED
tcp        1      0 bt1.frec.bull.fr:35828      
bt1.frec.bull.fr:postgres   CLOSE_WAIT 
tcp        0      0 bt1.frec.bull.fr:35829      
bt1.frec.bull.fr:postgres   ESTABLISHED
tcp        0      0 bt1.frec.bull.fr:35832      
bt1.frec.bull.fr:postgres   ESTABLISHED
tcp        0      0 bt1.frec.bull.fr:postgres   
bt1.frec.bull.fr:35829      ESTABLISHED
tcp        0      0 bt1.frec.bull.fr:postgres   
bt1.frec.bull.fr:35831      ESTABLISHED
tcp        0      0 bt1.frec.bull.fr:postgres   
bt1.frec.bull.fr:35830      ESTABLISHED
tcp        0      0 bt1.frec.bull.fr:postgres   
bt1.frec.bull.fr:35832      ESTABLISHED
tcp        0      0 bt1.frec.bull.fr:postgres   
bt3.frec.bull.fr:35717      ESTABLISHED
tcp        0      0 bt1.frec.bull.fr:35833      
bt3.frec.bull.fr:postgres   ESTABLISHED


And on the SLAVE node :
[postgres at bt3 baseSlony]$ ps -eLf | grep post
postgres 22970     1 22970  0    1 Oct12 ?        00:00:00 
/opt/postgre/V813/bin/postmaster
postgres 22998 22970 22998  0    1 Oct12 ?        00:00:00 postgres: 
writer process       
postgres 22999 22970 22999  0    1 Oct12 ?        00:00:00 postgres: 
stats buffer process  
postgres 23000 22999 23000  0    1 Oct12 ?        00:00:00 postgres: 
stats collector process  
postgres 21011 22970 21011  0    1 08:55 ?        00:00:04 postgres: 
slony cave 1.2.3.4(35833) idle
postgres 32645     1 32645  0    1 09:03 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32654     1 32654  0    1 09:03 pts/1    00:00:00 /usr/bin/perl 
/usr/local/slony/bin/slon_watchdog 
--config=/usr/local/slony/etc/slon_tools.conf node2 30
postgres 32689 32645 32689  0    7 09:03 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32689 32645 32690  0    7 09:03 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32689 32645 32691  0    7 09:03 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32689 32645 32695  0    7 09:03 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32689 32645 32696  0    7 09:03 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32689 32645 32697  0    7 09:03 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32689 32645 32698  0    7 09:03 pts/1    00:00:00 
/opt/postgre/V813/bin//slon -s 1000 -d2 replication host=5.6.7.8 
dbname=cave user=slony port=5432
postgres 32692 22970 32692  0    1 09:03 ?        00:00:02 postgres: 
slony cave 5.6.7.8(35715) idle
postgres 32699 22970 32699  0    1 09:03 ?        00:00:00 postgres: 
slony cave 5.6.7.8(35716) idle
postgres 32700 22970 32700  0    1 09:03 ?        00:00:01 postgres: 
slony cave 5.6.7.8(35718) idle
postgres 32701 22970 32701  0    1 09:03 ?        00:00:03 postgres: 
slony cave 5.6.7.8(35719) idle


[postgres at bt3 baseSlony]$ ps axm | grep post
22970 ?        -      0:00 /opt/postgre/V813/bin/postmaster
22998 ?        -      0:00 postgres: writer process       
22999 ?        -      0:00 postgres: stats buffer process  
23000 ?        -      0:00 postgres: stats collector process  
21011 ?        -      0:04 postgres: slony cave 1.2.3.4(35833) idle
32645 pts/1    -      0:00 /opt/postgre/V813/bin//slon -s 1000 -d2 
replication host=5.6.7.8 dbname=cave user=slony port=5432
32689 pts/1    -      0:02 /opt/postgre/V813/bin//slon -s 1000 -d2 
replication host=5.6.7.8 dbname=cave user=slony port=5432
32692 ?        -      0:02 postgres: slony cave 5.6.7.8(35715) idle
32699 ?        -      0:00 postgres: slony cave 5.6.7.8(35716) idle
32700 ?        -      0:01 postgres: slony cave 5.6.7.8(35718) idle
32701 ?        -      0:03 postgres: slony cave 5.6.7.8(35719) idle

[postgres at bt3 baseSlony]$ netstat | grep post
tcp        0      0 bt3.frec.bull.fr:postgres   
bt3.frec.bull.fr:35716      ESTABLISHED
tcp        0      0 bt3.frec.bull.fr:postgres   
bt3.frec.bull.fr:35719      ESTABLISHED
tcp        0      0 bt3.frec.bull.fr:postgres   
bt3.frec.bull.fr:35718      ESTABLISHED
tcp        0      0 bt3.frec.bull.fr:postgres   
bt3.frec.bull.fr:35715      ESTABLISHED
tcp        0      0 bt3.frec.bull.fr:35718      
bt3.frec.bull.fr:postgres   ESTABLISHED
tcp        0      0 bt3.frec.bull.fr:35719      
bt3.frec.bull.fr:postgres   ESTABLISHED
tcp        0      0 bt3.frec.bull.fr:35716      
bt3.frec.bull.fr:postgres   ESTABLISHED
tcp        1      0 bt3.frec.bull.fr:35714      
bt3.frec.bull.fr:postgres   CLOSE_WAIT 
tcp        0      0 bt3.frec.bull.fr:35715      
bt3.frec.bull.fr:postgres   ESTABLISHED
tcp        0      0 bt3.frec.bull.fr:35717      
bt1.frec.bull.fr:postgres   ESTABLISHED
tcp        0      0 bt3.frec.bull.fr:postgres   
bt1.frec.bull.fr:35833      ESTABLISHED


I don't understand very well what happens with the "slon_start" command 
and I hope someone will give me an explanation or maybe a documentation 
in which I can find information about the internal process of Slony-I.

Sorry for the length of this e-mail and thank you to have read ot ! ;-)

Regards,
Alexandra


Andrew Sullivan wrote:

>On Mon, Oct 16, 2006 at 08:28:05AM -0400, Andrew Sullivan wrote:
>  
>
>>On Mon, Oct 16, 2006 at 08:55:29AM +0200, DANTE Alexandra wrote:
>>    
>>
>>>(very detailed, thanks !) but I didn't find a chapter or an other 
>>>documentation in which all the "slon" processes created with the 
>>>execution of the "slon_start" command are detailed.
>>>      
>>>
>
>So, to answer the original question, the reason you see all those
>slon processes is because the replication system is multithreaded. 
>On Linux, threads show up in ps as processes.  I don't think you do
>have that many open postgres connections.  If I'm reading your ps
>output correctly, it's only one per side, which is what I'd figure. 
>You can check for sure with netstat, I suppose.
>
>A
>
>  
>




More information about the Slony1-general mailing list