nohup

Storm ―― 单机环境搭建

匿名 (未验证) 提交于 2019-12-02 23:38:02
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m0_37809146/article/details/91365116 1. 安装环境要求 you need to install Storm’s dependencies on Nimbus and the worker machines. These are: Java 7+ (Apache Storm 1.x is tested through travis ci against both java 7 and java 8 JDKs) Python 2.6.6 (Python 3.x should work too, but is not tested as part of our CI enviornment) 按照 官方文档 的说明:storm 运行依赖于Java 7+ 和 Python 2.6.6 +,所以需要预先安装这两个软件。由于这两个软件在多个框架中都有依赖,其安装步骤单独整理至 : Linux环境下JDK安装 Linux环境下Python安装 2. 下载并解压 下载并解压,官方下载地址: http://storm.apache.org/downloads.html # tar -zxvf apache-storm-1.2.2.tar.gz 3. 配置环境变量 #

Use SSH to start a background process on a remote server, and exit session

浪尽此生 提交于 2019-12-02 23:25:52
I am using SSH to start a background process on a remote server. This is what I have at the moment: ssh remote_user@server.com "nohup process &" This works, in that the process does start. But the SSH session itself does not end until I hit Ctr-C. When I hit Ctr-C, the remote process continues to run in the background. I would like to place the ssh command in a script that I can run locally, so I would like the ssh session to exit automatically once the remote process has started. Is there a way to make this happen? The "-f" option to ssh tells ssh to run the remote command in the background

远程访问阿里云服务器jupyter

匿名 (未验证) 提交于 2019-12-02 22:51:30
官网链接 一、pip安装jupyter 安装Anaconda的话,会自动按照jupyter,就不需要再使用pip安装了 pip3 install jupyter 二、生成jupyter notebook配置文件 jupyter notebook --generate-config 记住生成配置文件的目录,一般是在/root/.jupyter 中 三、设置Jupyter登陆密码,生成对应密文 ipython #打开ipython from notebook.auth import passwd passwd() #复制生成的密文 设置浏览器Jupyter登录密码 Enter password: #输入密码 Verify password: #确认密码 四、修改配置文件 配置文件在当前用户默认根目录的 .jupyter 文件夹下,例如: /home/zql vi ~/.jupyter/jupyter_notebook_config.py 插入如下代码,粘贴刚刚生成的密文 c.NotebookApp.ip='*' c.NotebookApp.password = u'sha1:...刚才复制的那个密文' c.NotebookApp.open_browser = False c.NotebookApp.port =8888 c.NotebookApp.allow_remote_access

php 异步执行脚本

匿名 (未验证) 提交于 2019-12-02 22:11:45
这里说的异步执行是让php脚本在后台挂起一个执行具体操作的脚本,主脚本退出后,挂起的脚本还能继续执行。比如执行某些耗时操作或可以并行执行的操作,可以采用php异步执行的方式。主脚本和子脚本的通讯可以采用外部文件或memcached的方式。原理就是通过exec或system来执行一个外部命令。注意:本文所述的是针对Linux环境。 在Linux下要让一个脚本挂在后台执行可以在命令的结尾加上一个 “&” 符号,有时候这还不够,需要借助nohup命令,关于nohup,可以参考 http://www.netingcn.com/linux-nohup.html 。 CLI环境和Web环境执行的操作还不太一样。先来说CLI环境,这里需要用上nohup和&,同时还要把指定输出,如果不想要输出结果,可以把输出定向到/dev/null中。现在来做一个测试,假设在一个目录中有main.php、sub1.php和sub2.php,其中sub1和sub2内容一样都让sleep函数暂停一段时间。代码如下: 上述文件中main.php是作为主脚本,在命令行中执行php main.php,可以看到main.php脚本很快就执行完并退出。在使用ps aux | grep sub命令搜索进程,应该可以在后台看到上述的两个子脚本,说明成功挂起了子脚本。 在Web环境下

Linux nohup和&的功效

匿名 (未验证) 提交于 2019-12-02 21:59:42
nohup和&究竟有啥区别?不少同学进行了回复,但并不是所有同学都理解得全对,今天把自己挖的坑自己填了。 测试代码如下: 是一个输出hello与循环轮数的死循环程序,每输出一行就休眠1秒。 使用 ./a.out 前台运行程序,会是什么效果呢? 程序每隔一秒会在终端输出一个字符串。 使用 ./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进程还在。 这些只能通过kill把程序干掉了,killall之后,ps查看进程已经关闭。 killall之后

linux 定时任务替代大牛 工具 cronsun

匿名 (未验证) 提交于 2019-12-02 21:59:42
本文主要介绍功能,这里就简单写下关键步骤: 1、安装 MongoDB,强烈建议使用集群模式 2、安装 Etcd3,强烈建议使用集群模式 3、部署 cronsun ①、下载 cronsun: https://github.com/shunfei/cronsun/releases (选择最新版本即可) ②、解压后修改 conf 目录下的配置文件:db.json 和 etcd.json,分别修改 MongoDB 和 etcd 的实际地址。(通过修改security.json文件可以设置安全性的一些信息,比方说可以执行的用户,那些脚本被支持) ③、启动 web:./cronweb -conf conf/base.json (若要后台运行则使用 nohup) ④、启动 node:./cronnode -conf conf/base.json (若要后台运行则使用 nohup) ⑤、访问前台: http://192.168.197.130:7079/ui/ 文章来源: linux 定时任务替代大牛 工具 cronsun

linux-node后台启动

匿名 (未验证) 提交于 2019-12-02 21:59:42
linux 后台启动node服务,如果直接使用 node server.js 命令; 跑起来之后,一旦退出,服务随机停止;通常有两种方式可以让代码在后台启动; 1 nohup 1.1 基本命令 nohup node server.js& 注意,运行此命令时需要在server.js 目录下方可; 1.2 用过的一些命令-多个端口启动 cd /home/node && nohup node app.js -lp 3001 >log1.log & cd /home/node && nohup node app.js -lp 3002 >log2.log & cd /home/ && nohup node app.js -lp 3003 >log3.log & 1.3 个人使用过程中有意外退出的情况 一般使用第二种方式forever; 2 forever,forever功能很强大,也很多,此处只列出目前用到的一些基本的 2.1 安装forever npm install forever -g 2.2 启动服务 service forever start 此处可能会报一些错误,一般可以不用理会,主要是看它的命令是否执行; 2.3 使用forever 启动js forever start app.js 2.4 停止js文件 forever stop app.js 2.5 输出日志

Linux(Centos)简单部署一个nginx+spring cloud项目

匿名 (未验证) 提交于 2019-12-02 21:59:42
1.以spring boot为基础新建一个eureka的项目 pom里面配置相关的插件 同时设置程序的主入口,这个服务是打成jar包 <groupId> com.springcloud.eureka </groupId> <artifactId> eurekatest </artifactId> <version> 1.0-SNAPSHOT </version> <packaging> jar </packaging> <properties> <project.build.sourceEncoding> UTF-8 </project.build.sourceEncoding> <jdk.version> 1.8 </jdk.version> </properties> 因为服务器配置的jdk是1.8的 2.通过maven插件进行打包,mvn clean 然后 mvn package 3.找到相应jar包的位置 首先服务器要安装jdk, https://blog.csdn.net/lizhen1114/article/details/79538594 上传至服务器 4.运行jar包,在运行之前最好,现在本地电脑做一下测试 nohup java -jar eurekatest-1.0-SNAPSHOT.jar >/dev/null 2>&1 & 其中nohup命令代表后台运行,

Getting sudo and nohup to work together

早过忘川 提交于 2019-12-02 20:08:49
Linux newbie here. I have a perl script which takes two command line inputs. I tried to run it in the background but this is what I got: [~user]$ nohup sudo ./ascii_loader_script.pl 20070502 ctm_20070502.csv & [2] 19603 [~user]$ nohup: appending output to `nohup.out' after the system returns "nohup: appending output to `nohup.out'", no new prompt will appear. Then as long as I type in some other command, the shell will tell me that the process is stopped: [~user]$ nohup sudo ./ascii_loader_script.pl 20070502 ctm_20070502.csv & [2] 19603 [~user]$ nohup: appending output to `nohup.out' ls ascii

How to get a list of programs running with nohup

蓝咒 提交于 2019-12-02 15:42:45
I am accessing a server running CentOS (linux distribution) with an SSH connection. Since I can't always stay logged in, I use "nohup [command] &" to run my programs. I couldn't find how to get a list of all the programs I started using nohup. "jobs" only works out before I log out. After that, if I log back again, the jobs command shows me nothing, but I can see in my log files that my programs are still running. Is there a way to get a list of all the programs that I started using "nohup" ? When I started with $ nohup storm dev-zookeper , METHOD1 : using jobs , prayagupd@prayagupd:/home