แก้ปัญหา Start PostgreSQL ไม่ได้ เจอ Error could not create shared memory segment: Invalid argument

PostgreSQL แชร์ความรู้เกี่ยวกับ PostgreSQL การใช้งาน ฟังก์ชั่นต่างๆ การเขียน SQL แบบ PGSQL

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41131
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

แก้ปัญหา Start PostgreSQL ไม่ได้ เจอ Error could not create shared memory segment: Invalid argument

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

แก้ปัญหา Start PostgreSQL ไม่ได้
เจอ Error
could not create shared memory segment: Invalid argument
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41131
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: แก้ปัญหา Start PostgreSQL ไม่ได้ เจอ Error could not create shared memory segment: Invalid argument

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ลอง restart เจอ Error ประมาณ นี้
sudo service postgresql restart
* Restarting PostgreSQL 9.1 database server * The PostgreSQL server failed to start. Please check the log output:
2018-02-08 18:42:36 ICT FATAL: could not create shared memory segment: Invalid argument
2018-02-08 18:42:36 ICT DETAIL: Failed system call was shmget(key=5678001, size=288940032, 03600).
2018-02-08 18:42:36 ICT HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 288940032 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared memory configuration.
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41131
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

Re: แก้ปัญหา Start PostgreSQL ไม่ได้ เจอ Error could not create shared memory segment: Invalid argument

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

ปัญหามาจาก การตั้งค่า shared memory มากเกินไป
วิธีแก้
nano /etc/postgresql/[pgsqql เวอร์ชั่น]/main/postgresql.conf
เช่น

โค้ด: เลือกทั้งหมด

nano /etc/postgresql/9.1/main/postgresql.conf
แก้
shared_buffers = 128MB #24MB

สำหรับเครื่อง ram 1-2 GB
เติมค่า

โค้ด: เลือกทั้งหมด

sysctl -w kernel.shmmax=134217728
$ sysctl -w kernel.shmall=2097152
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 29