Показаны сообщения с ярлыком postgresql. Показать все сообщения
Показаны сообщения с ярлыком postgresql. Показать все сообщения

воскресенье, 7 апреля 2013 г.

shmmax error for start postgresql

During start postgresql appear error  
Apr 07 12:38:55 localhost.localdomain pg_ctl[9810]: FATAL: could not create shared memory segment: Invalid argument 
Apr 07 12:38:55 localhost.localdomain pg_ctl[9810]: DETAIL: Failed system call was shmget(key=5432001, size=41279488, 03600). 
Apr 07 12:38:55 localhost.localdomain pg_ctl[9810]: HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your ker...nections. 
Apr 07 12:38:55 localhost.localdomain pg_ctl[9810]: If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter...lled for. 
Apr 07 12:38:55 localhost.localdomain pg_ctl[9810]: The PostgreSQL documentation contains more information about shared memory configuration. 
Apr 07 12:39:00 localhost.localdomain pg_ctl[9810]: pg_ctl: could not start server Apr 07 12:39:00 localhost.localdomain pg_ctl[9810]: Examine the log output.

fix in chef recipes

shmmax='kernel.shmmax=335544320' 
execute "set shmax" do
 command "sysctl -w #{shmmax}" 
end 

file "/etc/sysctl.d/shmmax.conf" do
 content shmmax 
end

воскресенье, 27 марта 2011 г.

switch postgresql from standby to normal mode.

After configure hot standby on postgresql 9.0, i configure heartbeat for switch slave server to master.
require add to recovery.conf this line
trigger_file = '/var/lib/pgsql/9.0/data/MASTER'

And after
touch /var/lib/pgsql/9.0/data/MASTER
and service postgresql-9.0 restart
server work as read/write server.

for return to standby require sync db files between master and slave
and
mv /var/lib/pgsql/9.0/data/recovery.done /var/lib/pgsql/9.0/data/recovery.conf
and again restart postgresql server