実現したいこと
サーバー2機でPHPで構築したソフトウェアを冗長化運用したい
どちらかのサーバーが落ちても稼働し続ける仕組み作り
発生している問題
サーバー2号機をシャットダウンしてもシステムは問題なく稼働し続けるが、
サーバー1号機が落ちると、エラーメッセージが出力され、稼働が止まる
※エラーメッセージ
Warning: session_start(): Write of lock failed in /var/www/html/htdocs/
Warning: session_start(): Unable to clear session lock record in
Warning: Unknown: Failed to write session data (memcached). Please verify that the current setting of session.save_path is correct (localhost:11211,192.168.10.10:11211) in Unknown on line 0
各サーバー設定値
環境 サーバー1号機(192.168.1.10) サーバー2号機(192.168.1.20) PHP 5.6.33 Apache/2.2.15
vi /etc/php.d/50-memcached.ini(192.168.10.10)
session.save_handler = memcached
session.save_path = "localhost:11211,192.168.10.20:11211
memcached.sess_consistent_hash = On
vi /etc/php.d/50-memcached.ini(192.168.10.20)
session.save_handler = memcached
session.save_path = "localhost:11211,192.168.10.10:11211"
memcached.sess_consistent_hash = On
#vi /etc/httpd/conf.d/php.conf(192.168.10.10)
php_value session.save_handler "memcached"
php_value session.save_path "localhost:11211,192.168.10.20:11211"
#vi /etc/httpd/conf.d/php.conf(192.168.10.20)
php_value session.save_handler "memcached"
php_value session.save_path "localhost:11211,192.168.10.10:11211"
#vi /etc/sysconfig/memcached(192.168.10.10 / 192.168.10.20)
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-d -vv 1>> /var/log/memcached.log 2>> /var/log/memcached.log"

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。