1.2.16 database migration - out of memory [SOLVED]

Started by netmg, October 09, 2014, 06:12:21 PM

Previous topic - Next topic

netmg

We ran across this issue while upgrading from 1.2.14 to 1.2.16 on a Ubuntu 12.04 host and with help from Alex and Victor we found a solution and wanted to post here in case others ran into this same problem.

Environment:
   Ubuntu 12.04 (VM, 3Gb RAM)
   NetXMS 1.2.14 (upgrading to 1.2.16)
   Postgresql 9.1

Problem encountered:

   After installing all required .deb upgrade images successfully for 1.2.16 we ran the usual "nxdbmgr upgrade" command.  In this situation, nxdbmgr ran for quite a while then failed with:

      ...
      NOTICE:  CREATE TABLE / UNIQUE will create implicit index "tdata_rows_2627_record_id_key" for table "tdata_2627"
      NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "tdata_records_2627_pkey" for table "tdata_records_2627"
      NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "tdata_rows_2627_pkey" for table "tdata_rows_2627"
      WARNING:   out of shared memory


To fix this we made kernel and postgres config changes as below.  Of course specific values will need to be modified based on your environement (if it still fails, increase settings and try again):

1. edit /etc/sysctl.conf, adding the line:
      kernel.shmmax = 2000000000

2. force update (without reboot):
      # sysctl -p

3. modify postgresql.conf (in our environment, /etc/postgresql/9.1/main/postgresql.conf by uncommenting the following lines and changing their values to:

      shared_buffers = 1024MB
      temp_buffers = 32MB
      max_locks_per_transaction = 256


4. restart postgres (/etc/init.d/postgresql restart) and re-run the "nxdbmgr upgrade". 

You should be all set!








     

tomaskir