nohup

RocketMQ环境搭建

[亡魂溺海] 提交于 2019-11-30 23:06:11
目录 RocketMQ 环境搭建 下载 快速入门 启动 nameserver 和 broker 测试生成消费 关闭 nameserver 和 broker RocketMQ 可视化工具 Docker 使用方式 参考 RocketMQ 环境搭建 下载 Release Notes - Apache RocketMQ - Version 4.5.2 快速入门 Quick Start 启动 nameserver 和 broker unzip rocketmq.zip cd rocketmq/ nohup sh bin/mqnamesrv & nohup sh bin/mqbroker -n localhost:9876 & 配置外网访问 在 conf 文件夹下修改 broker.conf 添加 namesrvAddr = xx.xx.xx.xx:9876;xx.xx.xx.xx:9876 # (多个地址以;分隔) brokerIP1 = xx.xx.xx.xx enablePropertyFilter = true 启动 namesrv nohup mqnamesrv & 启动 broker nohup mqbroker -n xx.xx.xx.xx:9876 autoCreateTopicEnable=true -c /usr/local/rocketmq/conf/broker

linux进程守护脚本

自作多情 提交于 2019-11-30 18:14:19
为了防止进程异常挂掉,为了避免影响业务,编写一个守护进程,定时检查某个进程是否存在,如果不存在则自动启动该进程。 编写脚本文件daemon.sh文件 while true; do server=`ps aux | grep test| grep -v grep` if [ ! "$server" ]; then cd 目录 nohup java -jar -XX:PermSize=128m -Xms1024m -Xmx1024m test.jar & fi sleep 5 done 启动命令 nohup ./daemon.sh & 来源: https://www.cnblogs.com/zhangmingcheng/p/11634500.html

nohup VERBOSE=1 perl script.pl

浪尽此生 提交于 2019-11-30 17:24:11
I have a perl script for which ENV variables can be set to direct specific outputs e.g. $debug, $verbose, $develop etc Usually I run these from the command line $ VERBOSE=1 perl myperlscript.pl params I now want to run them using nohup. Using the command line $ nohup VERBOSE=1 perl myperlscript.pl params is clearly not right, as the attempt to set ENV{VERBOSE} is interpreted as a param to nohup & I get the msg nohup: failed to run command `VERBOSE=1': No such file or directory What IS the correct syntax here? I'm trying to run this on a linux box. Set the environment variable before calling

nohup VERBOSE=1 perl script.pl

拈花ヽ惹草 提交于 2019-11-30 16:38:31
问题 I have a perl script for which ENV variables can be set to direct specific outputs e.g. $debug, $verbose, $develop etc Usually I run these from the command line $ VERBOSE=1 perl myperlscript.pl params I now want to run them using nohup. Using the command line $ nohup VERBOSE=1 perl myperlscript.pl params is clearly not right, as the attempt to set ENV{VERBOSE} is interpreted as a param to nohup & I get the msg nohup: failed to run command `VERBOSE=1': No such file or directory What IS the

scp & 进程管理 & 服务

半世苍凉 提交于 2019-11-30 15:12:45
SCP命令 -P为端口参数紧接端口参数,不要有空格,后面两个为文件路径,拷贝方向为从前向后,不区分本地与远端路径 远端路径格式:用户名@地址:远端路径 栗子: scp -P22000 ./clearLog.sh root@211.149.215.86:/root/taskBash SELinux ps -l 显示正在执行的前台程序 Tips:在执行命令的时候,尾部添加 & 该命令将会以后台形式进行执行 后台指令、切换管理 ctrl+z 前台指令运行中 可以使用 ctrl+z 将当前指令转至后台暂停 fg n 将ctrl+z放置到后台的程序唤醒回前台继续执行,n为暂停时出现的编号 bg n 将暂停的指令以后台形式继续运行,n为暂停时的编号 脱机运行程序 nohup 使用nohup指令, nohup不支持bash内建指令 ,所以请使用shellScript脚本执行,栗子 # & 后台运行 nohup ./test.bash & 执行后,会输出提示语,按一下回车即可回到前台,登出操作不会中断指令执行 进程管理 top : 动态查看进程信息,类似win下面的任务管理器,进入后shift+e可以切换存储显示单位 ps :显示进程列表相关信息 pstree :查看当前进程树 [root@www ~]# ps aux <==观察系统所有癿程序数据 [root@www ~]# ps -lA <=

解析nohup java -jar xxx &

北战南征 提交于 2019-11-30 13:23:02
一直就知道 java -jar xx ctrl+c就退出了 来自这个文 https://blog.csdn.net/wngpenghao/article/details/83022185 java -jar XXX.jar & 命令结尾没有 “&” ,则变成 “java -jar XXX.jar ” ,表示在当前ssh窗口,可按CTRL + C打断程序运行,或者直接关闭窗口,则程序直接退出 命令结尾添加 “&” ,则变成 “java -jar XXX.jar &” ,表示在当窗口关闭时,程序才会中止运行。&代表让该命令在后台执行。 nohup java -jar XXX.jar > Log.log & 或者 nohup java -jar XXX.jar >> Log.log & 命令 "nohup java -jar XXX.jar &" 部分,表示不挂断运行命令,当账户退出或终端关闭时,程序仍然运行。注意,该作业的所有输出被重定向到nohup.out的文件中。 命令 "nohup java -jar XXX.jar > Log.log &" 部分,表示不挂断运行命令,当账户退出或终端关闭时,程序仍然运行,并且该作业的所有输出被重定向到Log.log的文件中。“ > Log.log ” 该命令就是指定日志输出的文件。 ">>"表示将输出以追加的方式重定向到Log.log中。

Find the Process run by nohup command

我是研究僧i 提交于 2019-11-30 12:57:50
问题 I run a server executable in Centos using the following command "nohup server &" . Now I need to kill the process "server" . But I tried "ps -a" command to get the PID but I couldnt get the process. Now how to kill the "server" now? 回答1: ps auxwww|grep -i 'server' should return all process which has server in them. Otherwise, server may have already stopped. You should be able to determine the PID (and store it in a file) as follows: nohup server & print $! >> my_server.pid 回答2: If a nohup

linux运行jar以及vi

淺唱寂寞╮ 提交于 2019-11-30 12:55:41
linux运行jar包 java -jar XXX.jar 注:锁定当前 ssh 窗口,按CTRL+C打断程序运行,或直接关闭窗口,程序退出 java -jar XXX.jar & 注:& 代表在后台运行,不锁定当前窗口,但当前窗口关闭,程序结束运行 nohup java -jar XXX.jar & 注: nohup:不挂断运行命名,当前账户退出或终端关闭,程序仍然运行 nohup java -jar >temp.txt & 注:command >out.file command >out.file是将command的输出重定向到out.file文件,将输出文字不打印到屏幕上,而是输出到out.file中 查看所有后台运行的任务命令 jbos 列出所有后台运行的程序,并且前台带编号 fg [编号] 将制定编号的程序调回到前台执行 查看某个端口占用的线程PID netstat -nlp |grep ‘8080’ #查看8080端口占用的线程pid 杀死线程 kill -9 PID 查看端口被占用 netstat -an|grep ‘80’ 或 ps 查看运行的java进程 ps -ef|grep java 来源: https://www.cnblogs.com/monkay/p/11589758.html

Linux nohup和&的功效

a 夏天 提交于 2019-11-30 12:51:16
nohup和&究竟有啥区别?不少同学进行了回复,但并不是所有同学都理解得全对,今天把自己挖的坑自己填了。 测试代码如下: 是一个输出hello与循环轮数的死循环程序,每输出一行就休眠1秒。 使用 ./a.out 前台运行程序,会是什么效果呢? 程序每隔一秒会在终端输出一个字符串。 此时如果键入Ctrl+C ,程序会收到一个SIGINT信号,如果不做特殊处理,程序的默认行为是终止(如上图)。 使用 ./a.out& 后台运行程序,会是什么效果呢? 如上图: 首先会在终端显示进程号是32389 键入Ctrl + C,发出SIGINT信号,程序会继续运行 ps确认一下,确认进程依然在运行,进程号是32389。 此时如果关掉session,程序会收到一个SIGHUP信号,此时会怎么样呢? ps再次确认,可以看到关闭session之后,进程号是32389的a.out进程也关闭了。 使用nohup ./a.out 又会是什么效果呢? 使用nohup 运行程序a.out,会发现: 前台没有出现进程号 有一个“忽略输入,输出至nohup.out”的提示 hello的输出也没有出现在前台 手动ps看进程号,这次a.out的进程号是32437。 此时如果关掉session,程序会收到一个SIGHUP信号,程序会不会关闭呢? 关掉session后,再次ps看一下,ID为32437的a.out进程还在。