`
bachmozart
  • 浏览: 111340 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

programming erlang - Distributed 那章的实验

阅读更多
试了下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多台机器的,没法实验了






分享到:
评论
2 楼 bachmozart 2009-03-27  
mryufeng 写道
short name和longname是无法相互通信的哦


呵呵,老大果然是有问必答,等我erlang的基础好点了再向你请教哈
1 楼 mryufeng 2009-03-27  
short name和longname是无法相互通信的哦

相关推荐

    Programming Erlang

    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 ...

    Erlang and OTP in Action

    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, ...

    Functional Programming pdf 2018

    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 ...

    erlanghandbook

    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 ...

    ElixirBooks:Elixir书籍清单

    3. **Distributed-Systems**:Elixir和OTP框架非常适合构建分布式系统,提供了高容错性和可扩展性。 4. **Erlang**:Erlang是Elixir的基础,两者都使用BEAM虚拟机,因此Erlang的相关知识是学习Elixir的重要组成部分...

    otp-system-documentation

    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 ...

    Learning Akka(PACKT,2015)

    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 ...

    CloudI:最低级别的云!

    当使用非Erlang编程语言进行软件扩展时,或在将软件系统(全部或部分)转换为Erlang编程语言期间,CloudI可以减轻软件开发风险(延迟或故障)。应该如何使用CloudI? CloudI API以任何受支持的语言(当前为C / C ++...

    The Little Elixir & OTP Guidebook

    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:Orbit-用于构建分布式系统的虚拟角色框架

    Orbit 提供了一个 Actor 模型,这是由 Erlang 和 Akka 等系统引入的,并在此基础上进行了扩展和优化。Actor 模型鼓励松耦合和高内聚,使得系统能够更好地应对故障和扩展。在 Orbit 中,你可以定义自己的 Actor 类型...

Global site tag (gtag.js) - Google Analytics