侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

hyperf框架常用命令-在centos7中退出命令及在docker容器中退出命令

swoole  /  管理员 发布于 3年前   2777

今天有的群里的同学问了一些这种问题,我就抽时间操作了一下并记录一下

手册很重要,基础更重要啊


一.centos7中的退出命令


1.退出hyperf

ctrl + c 


2.查看hyperf启动占用端口

netstat -anp | grep 9501
[root@hyperf ~]# netstat -anp | grep 9501
tcp        0      0 0.0.0.0:9501            0.0.0.0:*               LISTEN      13365/skeleton.Mast 
tcp        0      0 192.168.1.98:9501       192.168.1.38:40808      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40826      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40864      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40870      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40794      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40834      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40842      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40798      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40824      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40844      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40812      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40860      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40852      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40858      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40850      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40832      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40856      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40800      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40810      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40848      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40788      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40818      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40840      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40838      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40816      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40790      TIME_WAIT   -                   
tcp        0      0 192.168.1.98:9501       192.168.1.38:40804      TIME_WAIT   - 



3.杀掉hyperf启动占用的端口  如上界面的 13365

kill -9 13365


4.退出hyperf命令行模式 并在后台运行

直接叉掉远程连接的xshell界面 假如你是用这个的话 哈哈 


二.docker容器中的退出命令


1.查看容器id

[root@hyperf ~]# docker ps -a
CONTAINER ID   IMAGE                                   COMMAND                  CREATED        STATUS          PORTS                                                                                                         NAMES
1a0005f6e0db   80070f1f0c8f                            "docker-entrypoint.s…"   2 months ago   Up 2 months     4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 15691-15692/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp   rabbitmq
be8cf8bd2a78   goblog                                  "bee run"                3 months ago   Up 3 months     0.0.0.0:8080->8080/tcp                                                                                        goblogbeego
103fd0f26448   hyperf/hyperf:7.4-alpine-v3.11-swoole   "/bin/sh"                6 months ago   Up 43 minutes   0.0.0.0:9601->9601/tcp                                                                                        hyperf

2.进入已经启动运行中的容器中

docker exec -it 103fd0f26448 /bin/sh
[root@hyperf ~]# docker exec -it 103fd0f26448 /bin/sh
/ # ls -a
.           .dockerenv  data        etc         lib         mnt         proc        run         srv         tmp         var
..          bin         dev         home        media       opt         root        sbin        sys         usr
/ # cd data/project/
/data/project # ls
Dockerfile       app              composer.json    config           phpstan.neon     public           runtime          test
README.md        bin              composer.lock    deploy.test.yml  phpunit.xml      push.sh          storage          vendor
/data/project # netstat -anp | grep 9601
tcp        0      0 0.0.0.0:9601            0.0.0.0:*               LISTEN      49/skeleton.Master
/data/project # kill -9 49


/data/project # php bin/hyperf.php start
/data/project # php bin/hyperf.php start
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\Config\Listener\RegisterPropertyHandlerListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\Paginator\Listener\PageResolverListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\ExceptionHandler\Listener\ExceptionHandlerListener listener.
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\DbConnection\Listener\RegisterConnectionResolverListener listener.
[DEBUG] Event Hyperf\Framework\Event\BeforeMainServerStart handled by Hyperf\Amqp\Listener\BeforeMainServerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\BeforeMainServerStart handled by Hyperf\Task\Listener\InitServerListener listener.
[DEBUG] Event Hyperf\Framework\Event\BeforeMainServerStart handled by Hyperf\Process\Listener\BootProcessListener listener.
[DEBUG] Event Hyperf\Framework\Event\OnStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[INFO] TaskWorker#2 started.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\WebSocketServer\Listener\InitSenderListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Task\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[INFO] TaskWorker#3 started.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\WebSocketServer\Listener\InitSenderListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Task\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[INFO] TaskWorker#4 started.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\WebSocketServer\Listener\InitSenderListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Task\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[INFO] TaskWorker#5 started.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\WebSocketServer\Listener\InitSenderListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Task\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[DEBUG] Event Hyperf\Framework\Event\MainWorkerStart handled by Hyperf\Amqp\Listener\MainWorkerStartListener listener.
[INFO] Worker#0 started.
[INFO] WebSocket Server listening at 0.0.0.0:9602
[INFO] HTTP Server listening at 0.0.0.0:9601
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\WebSocketServer\Listener\InitSenderListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Task\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[DEBUG] Event Hyperf\Framework\Event\OnManagerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[INFO] Worker#1 started.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\WebSocketServer\Listener\InitSenderListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Task\Listener\AfterWorkerStartListener listener.
[DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[DEBUG] Crontab Foo have been registered.
[DEBUG] Event Hyperf\Process\Event\BeforeProcessHandle handled by Hyperf\Crontab\Listener\CrontabRegisterListener listener.
[DEBUG] Event Hyperf\Process\Event\BeforeProcessHandle handled by Hyperf\Server\Listener\InitProcessTitleListener listener.
[INFO] Process[queue.default.0] start.
[DEBUG] Event Hyperf\Process\Event\BeforeProcessHandle handled by Hyperf\Process\Listener\LogBeforeProcessStartListener listener.

3.退出容器进入本机 并且在后台运行

ctrl + p + q

备注:按住ctrl 键 在继续按p键  在继续按q键  

出现以下信息:

...
[INFO] Process[queue.default.0] start.
[DEBUG] Event Hyperf\Process\Event\BeforeProcessHandle handled by Hyperf\Process\Listener\LogBeforeProcessStartListener listener.
read escape sequence
[root@hyperf ~]# 


这样就退出容器中hyperf的命令行模式 并且在后台运行 一并退出容器进入本机了



  • 上一条:
    PHP基金会的成立
    下一条:
    Laravel如何查看磁盘空间占用,实现显示盘符效果
  • 昵称:

    邮箱:

    2条评论 (评论内容有缓存机制,请悉知!)
    最新最热

    @路过的靓仔:cdn静态资源被墙,已修复

    博主  2022-05-18 14:39:38 赞 (0)

    剩下好多 wait 状态的

    路过的靓仔  2022-05-17 15:54:35 赞 (0)
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • swoole协程通信之数据处理协程对数据进行读写,保存到协程上下文示例(0个评论)
    • swoole redis连接池应用优化之多协程频繁访问redis(0个评论)
    • php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例(2个评论)
    • php中使用hyperf框架调用文心千帆大模型实现国内版chatgpt功能示例(0个评论)
    • 在hyperf框架中使用基于protobuf的RPC生成器实现rpc服务(1个评论)
    • 近期文章
    • 在go+gin中使用"github.com/skip2/go-qrcode"实现url转二维码功能(0个评论)
    • 在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能(1个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能(0个评论)
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 欧盟关于强迫劳动的规定的官方举报渠道及官方举报网站(0个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf文件功能(0个评论)
    • Laravel从Accel获得5700万美元A轮融资(0个评论)
    • 在go + gin中gorm实现指定搜索/区间搜索分页列表功能接口实例(0个评论)
    • 在go语言中实现IP/CIDR的ip和netmask互转及IP段形式互转及ip是否存在IP/CIDR(0个评论)
    • PHP 8.4 Alpha 1现已发布!(0个评论)
    • 近期评论
    • 122 在

      学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..
    • 123 在

      Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..
    • 原梓番博客 在

      在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
    • 博主 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..
    • 1111 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
    • 2017-09
    • 2020-03
    • 2020-06
    • 2021-03
    • 2021-04
    • 2021-05
    • 2021-07
    • 2021-08
    • 2021-09
    • 2021-11
    • 2022-03
    • 2022-05
    • 2023-01
    • 2023-02
    • 2023-03
    • 2023-07
    • 2023-08
    • 2023-11
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客