composer require addcnos/laravel-gateway-worker
publish
php artisan vendor:publish --provider="Addcnos\GatewayWorker\GatewayWorkerServiceProvider"
copy config
cp vendor/addcnos/laravel-gateway-worker/config/gatewayworker.php config
edit bootstrap/app.php
, add
$app->register(Addcnos\GatewayWorker\GatewayWorkerServiceProvider::class);
// ...
$app->configure('gatewayworker');
php artisan gateway-worker:serve [start|stop|restart|status|connections|help]
for help
php artisan gateway-worker:serve --help
Cluster
Role | IP | Command |
---|---|---|
Register | 192.168.1.101 | php artisan gateway-worker:serve --register --register-bind=0.0.0.0:1215 |
Gateway | 192.168.2.102-105 | php artisan gateway-worker:serve --gateway --gateway-bind=0.0.0.0:1216 --register-address=192.168.1.101:1215 --lan-ip=192.168.1.xxx |
Businessworker | 192.168.1.106-110 | php artisan gateway-worker:serve --businessworker --register-address=192.168.1.101:1215 |
In One
php artisan --register --gateway --businessworker