一個服務(wù)器裝2個項(xiàng)目分別2個workerman,數(shù)據(jù)庫連接句柄會公用,怎么解決呢?
A系統(tǒng)和B系統(tǒng)都是裝在同臺Linux上,A系統(tǒng)有個workerman,數(shù)據(jù)庫是$dba = Db::instance('dba'),后面的數(shù)據(jù)庫操作都是用$dba來操作;B系統(tǒng)也有個workerman,數(shù)據(jù)庫是$dbb = Db::instance('dbb');
$gateway_text->name也改了,2個workerman服務(wù)啟動后,會出現(xiàn)client_id共用,數(shù)據(jù)庫連接也會公用(就是$dba會更新到$dbb里面去),今早把$dbb中的Applications\Chat\Config\Store.php
Store::$storePath = sys_get_temp_dir().'/workerman-chat/';
改了后 就穩(wěn)定了 難道就是這個問題?
還碰到個問題就是如果workerman啟動了,不小心把Store::$storePath目錄內(nèi)容刪掉(或者其他操作),這時需重啟workerman就php start.php stop,提示成功,但是再php start.php start -d提示:
Workerman start
PHP Warning: stream_socket_server(): unable to connect to tcp://0.0.0.0:58252 ( Address already in use) in Workerman/Worker.php on line 1172
重復(fù)幾次 還是這樣 ,只能重啟服務(wù)器就正常了,請問這個怎么解決呢?