就像普通java应用一样启动一个erlang虚拟机,程序在虚拟机上运行,没有交互界面。
一个办法是启动时带 -detached参数,这样erlang虚拟机就进入了所谓的detached模式,在detached模式中,erlang静悄悄的在背后运行,没有常见的那个交互终端界面。
例子:以detached模式启动一个my_app应用
erl -detached -name foo@192.168.1.103 -setcookie abc -s my_app
my_app就像普通的daemon应用一样在背后运行了
但是当要控制detached模式启动的erlang虚拟机时怎么办,比如退出应用,或者查看erlang应用状态等。
连接detached模式的erlang节点的方法就我所知有两种:
1。 通过远程shell JCL登录,在Programming Erlang的6.7.3节介绍了这个,简单的说就是ctrl+g后的那个shell界面。具体方法是:
i) 启动一个erlang节点:
erl -name bar@192.168.1.103 -setcookie abc
ii) ctrl+g进入shell JCL,然后远程连接detached模式的erlang:
--> r 'foo@192.168.1.103'
--> c
Eshell V5.7.1 (abort with ^G)
(foo@192.168.1.103)1>
就可以控制detached模式的erlang了
2。使用erl的-remsh参数
erl -name bar@192.168.1.103 -remsh foo@192.168.1.103 -setcookie abc
但这样attach上后不知道怎么恢复到原来的detached模式
个人觉得shell JCL的方式比较好,如果有多个detached模式的Erlang节点(不管是不是远程的),都可以用一个Erlang shell进行控制,有点screen的感觉了,呵呵。
detached模式比较符合我们常用的erlang启动方法。在mryufeng的
另一种实用的接入erlang控制台的方法中提到的方法也蛮好的说,但不知道可不可以远程接入。
嗯,先记下
注:
带-detached参数的启动可能等效于同时带-noshell和-noinput参数的启动,用
ps -ef|grep beam
查看-detached启动的erlang进程时就会发现包含了-noshell -noinput这俩参数。
参考资料
1.
Detached mode
2.
erl
3.
How to start an erlang applications from the command line non-interactively?
分享到:
相关推荐
startup_nacos_by_standalone.bat,windows下nacos的standalone模式启动
1.进行相应的解压操作之后,...4.进入bin目录执行 ./start-cluster.sh启动集群 (之前要做好ssh免密设置,可以省去输密码的麻烦) 5.查看Web UI 输入通过浏览器访问flink主节点的8081端口 http://192.168.198.129:8081
nacos-server-2.0.0 修改成了单例模式,可以自行修改成集群模式
VMware vCenter Converter Standalone的使用 ,应用于各类虚拟机设备
jython-standalone-2.7.1 burpsuite的python环境配置
jackrabbit-standalone-1.6.5.jar是webDav的支持jar包。
linux standalone.conf linux standalone.sh 的启动配置文件
jython-standalone-2.7.2.jar,java应用调用Python。
通过允许服务与桌面交互方式启动或终止指定应用程序。2011.8.16 1、使用.Net Framework目录下的命令installutil安装服务 installutil (服务程序的绝对路径) 如:C:\Windows\Microsoft.NET\Framework\v4.0....
VMware vCenter Converter Standalone Installer for Windows
tyrus-standalone-client-1.13.1.jar
一个将Python代码转换成Java代码的编译器,能够将自己用Python代码写的类库用在Java程序里,有需要的可以下载,亲测可用。 如果windows的用户安装插件有问题的,尝试一下换这个jython: Jython官网: ...
VMware Converter Standalone 6.1.1 P2V迁移Linux一例
挣点辛苦币下载东西,没办法 E:\code\keycloak-11.0.3\standalone\configuration\standalone.xml
VMware vCenter Converter standalone 6.2 guide 的最新英文版
hive-jdbc-3.1.2-standalone适用于linux
mule standalone server 3
5g-standalone-access-registrationflow.pdf5g-standalone-access-registrationflow.pdf5g-standalone-access-registrationflow.pdf5g-standalone-access-registrationflow.pdf5g-standalone-access-...
mule-standalone ESB 企业服务总线的开发工具,欢迎大家使用
standalone-chrome part1