GT.M uses UNIX IPC resources as follows:
The steps of this task are as follows:
$ export gtm_repl_instance=multisite.repl $ mupip replicate -instance_create -name=America $ mupip set -replication=on -region "*" $ mupip replicate -source -start -buf=1048576 -secondary=Server_B:1234 -log=A2B.log -instsecondary=Brazil
Now execute the following command:
$ gtm_dist/ftok mumps.dat multisite.repl
mumps.dat :: 721434869 [ 0x2b0038f5 ] multisite.repl :: 721434871 [ 0x2b0038f7 ]
------ Semaphore Arrays -------- key semid owner perms nsems 0xd74e4524 196608 welsley 660 1 0x2c0038f7 983041 welsley 777 3 0x00000000 1015810 welsley 777 5 0x2b0038f5 1048579 welsley 777 3 0x00000000 1081348 welsley 777 3
Note You can expect files in separate file systems to share the same public
ftok
. This is a normal behavior for large systems with multiple installations and does not affect GT.M operations in any way. This is because GT.M does not assume the semaphore has a one-to-one relationship with the resource and startup/shutdown operations are relatively rare, so the interference among resources have a minimal or no impact. However, the private semaphore (with the0
key) is unique for a database and is used while a process is actively using the resource.$ mupip ftok mumps.dat
File :: Semaphore Id :: Shared Memory Id :: FileId --------------------------------------------------------------------------------------------------------------- mumps.dat :: 1081348 [0x00108004] :: 2490370 [0x00260002] :: 0xf53803000000000000fe000000000000ffffffd2
$ mupip ftok -jnl multisite.repl
The sample output of this command looks like the following:
File :: Semaphore Id :: Shared Memory Id :: FileId --------------------------------------------------------------------------------------------------------------- multisite.repl :: 1015810 [0x000f8002] :: 2457601 [0x00258001] :: 0xf73803000000000000fe000000000000ffffffd2
------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 0 root 777 122880 1 0x00000000 2457601 welsley 777 1048576 1 0x00000000 2490370 welsley 777 2633728 1 0x00000000 2523139 welsley 600 393216 2 dest 0x00000000 2555908 welsley 600 393216 2 dest 0x00000000 1048583 welsley 600 393216 2 dest 0x00000000 1081352 welsley 600 393216 2 dest 0x00000000 1114121 welsley 666 376320 2 0xd74e4524 1146890 welsley 660 64528 0 0x00000000 1933323 welsley 666 62500 2 0x00000000 1966092 welsley 666 1960000 2 ------ Semaphore Arrays -------- key semid owner perms nsems 0xd74e4524 196608 welsley 660 1 0x2c0038f7 983041 welsley 777 3 0x00000000 1015810 welsley 777 5 0x2b0038f5 1048579 welsley 777 3 0x00000000 1081348 welsley 777 3 ------ Message Queues -------- key msqid owner perms used-bytes messages
IPCs = (n regions * (1 shm/region + 1 ftok sem/region + 1 private sem/region)) + 1 sem/journal-pool + 1 sem/receiver-pool
In this case, America has one region and no receiver-pool so:
1 region * 3 IPCs/region + 1 IPC/journal-pool = 4 IPCs
Note For
MUPIP RECOVER
operations the total number of IPC resources are3
(As there is no Journal Pool or Receiver Pool) wheren
n
is the number of regions.$ export gtm_repl_instance=multisite1.repl $ mupip replicate -instance_create -name=Brazil $ mupip rundown -region "*" $ mupip set -journal="enable,before,on" -replication=on -region "*" $ mupip replicate -source -start -passive -buf=1048576 -log=B2dummy.log -inst=dummy $ mupip replicate -receive -start -listenport=1234 -buf=1048576 -log=BFrA.log
$gtm_dist/ftok mumps.dat multisite1.repl
mumps.dat :: 722134735 [ 0x2b0ae6cf ] multisite1.repl :: 722134737 [ 0x2b0ae6d1 ]
$ mupip ftok mumps.dat
File :: Semaphore Id :: Shared Memory Id :: FileId -------------------------------------------------------------------------------------------------------------- mumps.dat :: 327683 [0x00050003] :: 11665410 [0x00b20002]:: 0xcfe63400000000000a0000000000000000000000
$ mupip ftok -jnl multisite1.repl
The sample output of this command looks like the following:
File :: Semaphore Id :: Shared Memory Id :: FileId --------------------------------------------------------------------------------------------------------------- multisite1.repl :: 262145 [0x00040001] :: 11632641[0x00b18001]:: 0xd1e63400000000000a0000000000000000000
Now, execute the command
ipcs -a
to view the IPC resources of Brazil.This command produces a sample output like the following:
------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 11632641 gtmuser 777 1048576 3 0x00000000 11665410 gtmuser 777 2629632 2 0x00000000 11698179 gtmuser 777 1048576 2 ------ Semaphore Arrays -------- key semid owner perms nsems 0x2c0ae6d1 229376 gtmuser 777 3 0x00000000 262145 gtmuser 777 5 0x2b0ae6cf 294914 gtmuser 777 3 0x00000000 327683 gtmuser 777 3 0x00000000 360452 gtmuser 777 5 ------ Message Queues -------- key msqid owner perms used-bytes messages