出現(xiàn)了一個很奇怪的現(xiàn)象:
本地 Windows 環(huán)境開發(fā)一個接口,本地測試沒問題后上傳 git 倉庫。
服務(wù)器 git pull 獲取更新。
執(zhí)行 php start.php reload(或 restart -d),此時請求新接口會 404 ,找不到新上傳的代碼,但是代碼確實已經(jīng)更新了。
或者不加新代碼,改舊的代碼也是沒有反應(yīng)過來,還是舊版本。
但是不知道過多久再請求又變成新代碼的邏輯了,代碼生效了。
但是再一次提交更新,又變回舊的邏輯了,代碼又不生效了。
如上,一直反復(fù)。
-------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.1.15 PHP version:8.2.24 Event-Loop:\Workerman\Events\Select
--------------------------------------------- WORKERS ---------------------------------------------
proto user worker listen processes status
tcp root webman http://0.0.0.0:8787 16 [OK]
tcp root monitor none 1 [OK]
---------------------------------------------------------------------------------------------------
運行 ps auxf
看下是不是運行了多個webman。
還有可能是請求走到其它服務(wù)器上去了,例如用了負載均衡或者域名有多個A記錄等原因
域名確定只解析到了這一個服務(wù)器IP,也沒有配置負載均衡啊。
[root@]# ps auxf
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
……
www 2946398 0.0 0.5 213960 42380 ? S 00:10 0:00 _ nginx: worker process
www 2946399 0.0 0.5 213960 39120 ? S 00:10 0:00 _ nginx: worker process
www 2946400 0.0 0.5 213960 39120 ? S 00:10 0:00 _ nginx: worker process
www 2946401 0.0 0.5 213960 39120 ? S 00:10 0:00 _ nginx: worker process
www 2946402 0.0 0.2 192620 18528 ? S 00:10 0:00 _ nginx: cache manager process
root 2188251 0.0 0.2 186084 15716 ? S Oct15 0:29 WorkerMan: worker process monitor
root 4189844 0.0 0.2 186084 16000 ? S Oct15 0:29 WorkerMan: worker process monitor
root 1804165 0.0 0.1 186084 15008 ? S Oct15 0:29 WorkerMan: worker process monitor
root 2339500 0.0 0.5 454344 45096 ? Ssl Oct15 0:01 /usr/libexec/platform-python -s /u
root 2343267 0.0 0.3 264864 24908 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343268 0.0 0.2 188132 17888 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343269 0.0 0.3 264864 25164 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343270 0.0 0.3 264864 24916 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343271 0.0 0.3 264864 25172 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343272 0.0 0.2 188132 18056 ? S Oct15 0:02 WorkerMan: worker process webman
root 2343273 0.0 0.2 188132 18892 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343274 0.0 0.2 188132 19652 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343275 0.0 0.2 188132 18056 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343276 0.0 0.3 264876 25692 ? S Oct15 0:03 WorkerMan: worker process webman
root 2343277 0.0 0.3 264876 24908 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343278 0.0 0.3 264864 25744 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343279 0.0 0.2 188132 19724 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343280 0.0 0.3 264864 25712 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343281 0.0 0.3 264864 25768 ? S Oct15 0:04 WorkerMan: worker process webman
root 2343282 0.0 0.2 186084 15752 ? S Oct15 0:28 WorkerMan: worker process monitor
root 2365108 0.0 0.2 188132 19600 ? S Oct16 0:03 WorkerMan: worker process webman
root 2365109 0.0 0.3 266912 27204 ? S Oct16 0:03 WorkerMan: worker process webman
root 2365110 0.0 0.3 264876 24924 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365111 0.0 0.3 266912 27744 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365112 0.0 0.3 264872 24620 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365113 0.0 0.3 266912 26832 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365114 0.0 0.3 264864 25008 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365115 0.0 0.2 188132 17796 ? S Oct16 0:03 WorkerMan: worker process webman
root 2365116 0.0 0.3 264864 25580 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365117 0.0 0.3 264880 25588 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365118 0.0 0.3 264876 25748 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365119 0.0 0.3 264864 24200 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365120 0.0 0.3 264864 25720 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365121 0.0 0.3 264880 25748 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365122 0.0 0.3 264864 24716 ? S Oct16 0:04 WorkerMan: worker process webman
root 2365123 0.0 0.1 186084 14920 ? S Oct16 0:28 WorkerMan: worker process monitor
root 2368175 0.0 0.1 188768 12968 ? Ss Oct16 0:20 php-fpm: master process (/www/serv
www 2368176 0.0 0.3 290972 23828 ? S Oct16 0:00 _ php-fpm: pool www
www 2368177 0.0 0.3 290984 23792 ? S Oct16 0:00 _ php-fpm: pool www
www 2368178 0.0 0.3 290980 23832 ? S Oct16 0:00 _ php-fpm: pool www
www 2368179 0.0 0.3 290984 23828 ? S Oct16 0:00 _ php-fpm: pool www
www 2368180 0.0 0.3 290984 23800 ? S Oct16 0:00 _ php-fpm: pool www
www 2368181 0.0 0.3 290984 23824 ? S Oct16 0:00 _ php-fpm: pool www
www 2368183 0.0 0.3 290988 23888 ? S Oct16 0:00 _ php-fpm: pool www
www 2368184 0.0 0.3 290984 23784 ? S Oct16 0:00 _ php-fpm: pool www
www 2368185 0.0 0.3 290984 23708 ? S Oct16 0:00 _ php-fpm: pool www
www 2368186 0.0 0.3 290988 23792 ? S Oct16 0:00 _ php-fpm: pool www
www 2803872 0.0 0.3 290984 23816 ? S Oct24 0:00 _ php-fpm: pool www
root 2912581 0.0 0.0 53352 7604 ? Ssl Oct26 0:53 /usr/local/aegis/aegis_update/AliY
root 2912660 0.2 0.2 117692 15708 ? Ssl Oct26 5:04 /usr/local/aegis/aegis_client/aegi
root 2912671 0.5 0.5 191700 38904 ? Ssl Oct26 10:15 /usr/local/aegis/aegis_client/aegi
root 2936130 0.0 0.1 184036 14776 ? S Oct26 0:00 WorkerMan: master process start_f
root 2936131 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936132 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936133 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936134 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936135 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936136 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936137 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936138 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936140 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936141 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936142 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936143 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936144 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936145 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936146 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936147 0.0 0.2 186084 15892 ? S Oct26 0:00 _ WorkerMan: worker process web
root 2936148 0.0 0.2 186084 15636 ? S Oct26 0:00 _ WorkerMan: worker process mon
root 2982442 0.0 1.2 216968 96928 ? Ss 11:52 0:06 /usr/lib/systemd/systemd-journald
系統(tǒng)里存在其它webman進程
執(zhí)行 ps aux|grep -i workerman|awk '{print $2}'|xargs kill -9
殺死所有workerman進程,然后重啟webman
試試php start.php stop && php start.php start -d。restart或者是reload,是不是一個一個重啟的,不是所有的服務(wù)都立即重啟,這個可能有個時間差。