RE: shmget: [EEXIST][17]: key 52584801: shared memory already exists
Posted in 2004
Hi,
have you meanwhile been able to resolve this issue ?
Some things to note:
- the key for SHM segments must be unique, systemwide unique.
- IDS generates the key from SERVERNUM parameter in the
$ONCONFIG file. Hence when running multiple instances on
the same machine, each must have its unique SERVERNUM.
Once you are sure that the above is all correctly configured and
you still have this problem:
- Use "ipcs -m" (check man page of ipcs for further syntax) to
determine which SHM segments exist on your system.
You may need to run this as user "root" to see all of them.
- Try the relevant options to "ipcs -m ..." to see, which process
created it. Cross check this process-ID using "ps -ef" or
similar command.
- Most likely it is another oninit process from another instance ...
- If the process no longer exists, then try to find out ("ipcs -m ...")
which process is still attached to the segment. This can be a
"dbaccess" or "onbar_d".
- If you found processes attached, but no corresponding "oninit"
process exists, then it's a left-over from a shutdown instance.
Most likely you can kill those other processes.
- Once no more processes are attached to the SHM segment,
you can (as user "root") remove the SHM segment using
"ipcrm ... <shmid>" where "..." is platform dependent and you
get the "shmid" from previous "ipcs -m" output.
After this you'll be able to start the instance without this error.
It can happen that there are further such SHM segments. If you get
error again, it should be with another "key"-number. In that case
you have to repeat the above process until there are no more such
SHM segments left over that correspond to the SERVERNUM in
question.
If you really get this error message after a reboot of the machine
(i.e. UNIX system, not just shutdown and start of the instance),
then you probably should check the UNIX start scripts as they seem
to do something that starts up an instance ... ?
Regrads,
Martin
--
Martin Fuerderer
IBM Informix Development Munich, Germany
Data Management Solutions
owner-informix-list@iiug.org wrote on 03.12.2004 02:05:17:
> Hi Sergey.
>
> Make sure your configration parameter.
> . Kernel Parameters
>
> The values of the kernel parameters that were used for testing this
> product are given below. These values might need to be tuned
depending
> on the application and availability of system resources. They
> can either be dynamically changed in the /proc file system or are
> defined
> in the kernel sources and can be changed by rebuilding the kernel.
>
> SHMMAX: 33554432
> SHMMIN: 1
> SHMMNI: 128
> SHMSEG: 128
> SHMALL: 4194304
> SEMMNI: 128
> SEMMSL: 250
> SEMMNS: 32000
> SEMOPM: 32
>
> Change kernel parameter, use sysctl -w.
> OR
> Edit /proc/sys/kernel/shm...
> /proc/sys/kernel/sem
>
> Probably you use 2 of SERVERNUM, change SERVERNUM to other.
> Then oninit -iv.(Dangaer , initialize your database!)
>
> Regards.
>
> --
> Tsutomu Ogiwara from Tokyo Japan.
> ICQ#:168106592
>
>
>
>
> >From: sshumilov@yahoo.com (Sergey)
> >Reply-To: sshumilov@yahoo.com (Sergey)
> >To: informix-list@iiug.org
> >Subject: shmget: [EEXIST][17]: key 52584801: shared memory already
exists
> >Date: 1 Dec 2004 23:20:46 -0800
> >
> >Hi!
> >Guys please help!!!
> >
> >I've tried everything with this shared memory segment(rebooted), but
> >nothing helped.
> >still doesn't want to do oninit -iv
> >
> >here is some tips...
> >
> >online.log
> >
> >Tue Nov 30 15:20:02 2004
> >
> >15:20:02 Event alarms enabled. ALARMPROG =
> >'/iif94/etc/alarmprogram.sh'
> >15:20:02 Booting Language <c> from module <>
> >15:20:02 Loading Module <CNULL>
> >15:20:02 Booting Language <builtin> from module <>
> >15:20:02 Loading Module <BUILTINNULL>
> >15:20:16 IBM Informix Dynamic Server Started.
> >15:20:16 shmget: [EEXIST][17]: key 52564801: shared memory already> >exists
> >15:20:16 mt_shm_init: can't create resident segment
> >
> >08:39:34 IBM Informix Dynamic Server Started.
> >08:39:34 shmget: [EEXIST][17]: key 52584801: shared memory already> >exists
> >08:39:34 mt_shm_init: can't create resident segment
> >
> >08:39:40 IBM Informix Dynamic Server Started.
> >08:39:40 shmget: [EEXIST][17]: key 52584801: shared memory already> >exists
> >08:39:40 mt_shm_init: can't create resident segment> >
> >
> >
> >and onconfig file
> >
> >
> ># Root Dbspace Configuration
> >
> >ROOTNAME rootdbs # Root dbspace name> >ROOTPATH /work/chunks/tester94/root_chunk # Path for device
> >containing root dbspace
> >ROOTOFFSET 0 # Offset of root dbspace into device
> >(Kbytes)
> >ROOTSIZE 30000 # Size of root dbspace (Kbytes)> >
> ># Disk Mirroring Configuration Parameters
> >
> >MIRROR 1 # Mirroring flag (Yes = 1, No = 0)
> >MIRRORPATH # Path for device containing mirrored> >root
> >MIRROROFFSET 0 # Offset into mirrored device (Kbytes)> >
> ># Physical Log Configuration
> >
> >PHYSDBS rootdbs # Location (dbspace) of physical log
> >PHYSFILE 2000 # Physical log file size (Kbytes)> >
> ># Logical Log Configuration
> >
> >LOGFILES 6 # Number of logical log files
> >LOGSIZE 2000 # Logical log size (Kbytes)> >
> ># Diagnostics
> >
> >MSGPATH /iif94/online.log # System message log file path
> >CONSOLE /dev/console # System console message path> >
> ># To automatically backup logical logs, edit alarmprogram.sh and set
> ># BACKUPLOGS=Y
> >ALARMPROGRAM /iif94/etc/alarmprogram.sh # Alarm program path
> >TBLSPACE_STATS 1 # Maintain tblspace statistics> >
> ># System Archive Tape Device
> >
> >TAPEDEV /dev/nul # Tape device path
> >TAPEBLK 32 # Tape block size (Kbytes)
> >TAPESIZE 10240 # Maximum amount of data to put on
> >tape (Kbytes)> >
> ># Log Archive Tape Device
> >
> >LTAPEDEV /dev/nul # Log tape device path
> >LTAPEBLK 32 # Log tape block size (Kbytes)
> >LTAPESIZE 10240 # Max amount of data to put on log
> >tape (Kbytes)> >
> ># Optical
> >
> >STAGEBLOB # Informix Dynamic Server staging area
> >
> ># System Configuration
> >
> >SERVERNUM 2 # Unique id corresponding to a OnLine> >instance
> >DBSERVERNAME tester94 # Name of default database server
> >DBSERVERALIASES # List of alternate dbservernames
> >NETTYPE # Configure poll thread(s) for nettype
> >DEADLOCK_TIMEOUT 60 # Max time to wait of lock in@@N