试了下programming erlang distributed 那章的例子,记录一下
一. erl -name
实验一:
我把kvs那个程序放在了A,B两台服务器上,这两台服务器的hostname()都没设置
在B服务器上执行了 erl -name bachmozart@erlang.xxxx.com -setcookie abc
然后 kvs:start().
在A服务器上 首先配置etc/hosts B服务器地址 erlang.xxxx.com
然后启动shell erl -name me -setcookie abc
执行:rpc:call(bachmozart@erlang.xxxx.com,kvs,lookup,[k1]).
执行成功
实验二:
在A服务器/etc/hosts上添加了 -> B服务器地址 erlang
在B服务器上执行 erl -name bachmozart@erlang -setcookie abc
kvs:start().
在A服务器上执行 erl -name mi -setcookie abc
执行:rpc:call(bachmozart@erlang,kvs,store,[k1,v1]).
执行失败:错误信息
=ERROR REPORT==== 25-Mar-2009::13:31:29 ===
** System running to use fully qualified hostnames **
** Hostname erlang is illegal **
二. erl -sname
实验一:
在B服务器上
erl -sname bachmozart@erlang -setcookie abc
kvs:start().
A服务器上
erl -sname mii -setcookie abc
rpc:call(bachmozart@erlang,kvs,store,[k1,k2]).
执行成功
实验二:
在B服务器上
erl -sname bachmozart@erlang.xxxx.com -setcookie abc
启动失败
在概念上有了些认识,不过现在还不敢妄下结论
应该试下直接通过DNS的方式,公司的DNS是负载均衡到N多台机器的,没法实验了
分享到:
相关推荐
Erlang is a programming language designed for building highly parallel, distributed, fault-tolerant systems. It has been used commercially for many years to build massive fault-tolerant systems which ...
You’ll delve into the Erlang language and OTP runtime by building several progressively more interesting real-world distributed applications. Once you are competent in the fundamentals of Erlang, ...
a new functional language built on the powerful Erlang base.The industry has been embracing functional programming more and more, driven by the need for concurrency and parallelism. This collection ...
Erlang supports distributed programming through a simple and powerful mechanism. Nodes can communicate with each other as if they were running on the same machine, enabling seamless scaling across ...
3. **Distributed-Systems**:Elixir和OTP框架非常适合构建分布式系统,提供了高容错性和可扩展性。 4. **Erlang**:Erlang是Elixir的基础,两者都使用BEAM虚拟机,因此Erlang的相关知识是学习Elixir的重要组成部分...
The OTP (Open Telecom Platform) is a middleware framework for building highly scalable and fault-tolerant applications using the Erlang programming language. Developed by Ericsson, the OTP system ...
As well as simplifying development, Akka enables multiple concurrency development patterns with particular support and architecture derived from Erlang’s concept of actors (lightweight concurrent ...
当使用非Erlang编程语言进行软件扩展时,或在将软件系统(全部或部分)转换为Erlang编程语言期间,CloudI可以减轻软件开发风险(延迟或故障)。应该如何使用CloudI? CloudI API以任何受支持的语言(当前为C / C ++...
The Little Elixir & OTP Guidebook gets you ... Then, you'll dive straight into OTP and learn how it helps you build scalable, fault-tolerant and distributed applications through several fun examples.
Orbit 提供了一个 Actor 模型,这是由 Erlang 和 Akka 等系统引入的,并在此基础上进行了扩展和优化。Actor 模型鼓励松耦合和高内聚,使得系统能够更好地应对故障和扩展。在 Orbit 中,你可以定义自己的 Actor 类型...