erlang

[推荐] Windows 安装和配置 RabbitMQ 服务器详细图文步骤

时光毁灭记忆、已成空白 提交于 2019-12-19 16:29:46
文章目录 一、下载并安装 Erlang 安装 Erlang 设置 ERLANG_HOME 环境变量 验证Erlang是否安装成功: 二、下载并安装 RabbitMQ 安装 RabbitMQ 设置RABBITQM_SERVER环境变量 三、安装 rabbitmq_management 查看 RabbtitMQ 的所有插件 安装 rabbitmq_management 可视化界面插件 四、管理 rabbitmq_management 用户 查看 rabbitmq 已注册用户 创建一个用户 给用户root设置tag 五、利用Python实现测试 Producer 生产者代码 Consumer 消费者代码 RabbitMQ是一个在AMQP协议标准基础上完善的,可复用的消息中间件。 它遵循Mozilla Public License开源协议,采用 Erlang 实现的工业级的消息队列(MQ)服务器,Rabbit MQ 是建立在Erlang OTP平台上; 具有可伸缩性(即集群服务),消息持久化的特性。 好文章 记得 收藏 + 点赞 + 关注 额 !!! ---- Nick.Peng 一、下载并安装 Erlang 因为 RabbitMQ 服务器是基于 Erlang 环境的,所以安装 RabbitMQ 服务器前必须先安装 Erlang; 安装 Erlang 时要注意安装的 RabbityMQ

Rabbit安装(单机及集群,阿里云)

不打扰是莪最后的温柔 提交于 2019-12-19 16:12:20
Rabbit安装(单机及集群,阿里云) 前言 虽然我并不是部署人员,但是自己私人测试环境的各类东东还是得自己安装的。 尤其在规模不大的公司,基本安装部署工作都是后端的份内之事。 那么最令人痛苦的,莫过于自己就是安装大佬教程走,但是就是过不去。尤其是初学者,解决问题的能力,还不足,往往就直接卡死了。 其实还有另外一个问题,那就是很多的教程,包括许多视频的教学,大多采用不真实的环境。要么是多台虚拟机实现集群,要么是一台线上服务器走天下。当然作者们也有着诸多考虑,有的是为了学员可以零成本的感受安装,另一方面学员大多都是学习知识,而不是为了实际应用(真的懂得,又不大需要这个东东)。最重要的是,学习阶段,大部分安装都是单机的,可以满足需求了。 但是,我发现在很多的扣扣群,微信群依然存在着那么一批正式环境安装遇到各类问题,苦求无门的朋友。在我回复之后,部分人提议我可以将这部分经验发出来,帮助更多的人。 所以有了这个系列,我会通过真实的阿里服务器集群(三台),搭建各个中间件的集群等。 最后,由于打马赛克太麻烦了。并且我之后可能会开放安装视频,所以有的IP什么的,我并不方便打马赛克。但是希望你们不要做坏事儿哈。 Rabbit安装概述 简介 RabbitMQ是一款消息中间件,其安装分为: 单机安装(只有一台服务器,上面只有一个RabbitMQ的Broker实例) 多主集群转发数据

ejabberd how to compile new module

谁说胖子不能爱 提交于 2019-12-19 12:22:21
问题 Here I found the code: erlc -I ~/ejabberd-2.1.13/lib/ejabberd-2.1.13/include -pa ~/ejabberd-2.1.13/lib/ejabberd-2.1.13/ebin mod_my.erl But it did not work? 回答1: Here are steps to add your custom module into ejabberd put your module into ejabberd/src folder. come to ejabberd directory in terminal and run command $ sudo make it will show you that your module is compiled. Now run $ sudo make install Add your module into config file at /etc/ejabberd/ejabberd.yml restart your ejabberd and your

How to do pattern matching on a binary in Erlang?

妖精的绣舞 提交于 2019-12-19 10:36:35
问题 I would like to do recursion over a binary, and in each call read up to 32 bits from the binary, and return it in a new binary. But I can't get the pattern matching to work as I want. binaryToBinary(Source) -> binaryToBinaryAux(Source, <<>>). binaryToBinaryAux(<<>>, Target) -> Target; binaryToBinaryAux(<<H:32/binary, T/binary>>, Target) -> binaryToBinaryAux(<<T/binary>>, <<Target/binary, H>>). Here is the error I get for the pattern matching: 10> mymodule:binaryToBinary(<<"JonasPonas">>). **

what is ref in Erlang?

拟墨画扇 提交于 2019-12-19 08:31:51
问题 Going through this link To identify a process,we would be using a Pid.But when should a ref be used? I see this often while msg sending/receiving but unable to interpret what role it plays in message interaction. 回答1: To quote documentation A reference is a term which is unique in an Erlang runtime system, created by calling make_ref/0. This means that this is special data type, it's not an integer, not a list, and not a binary. Especially with unique prosperity. It's designed mostly to

what is ref in Erlang?

醉酒当歌 提交于 2019-12-19 08:31:01
问题 Going through this link To identify a process,we would be using a Pid.But when should a ref be used? I see this often while msg sending/receiving but unable to interpret what role it plays in message interaction. 回答1: To quote documentation A reference is a term which is unique in an Erlang runtime system, created by calling make_ref/0. This means that this is special data type, it's not an integer, not a list, and not a binary. Especially with unique prosperity. It's designed mostly to

Erlang/ets: reset ets table after getting a “bad argument”?

随声附和 提交于 2019-12-19 08:11:03
问题 I've been learning how to use ets, but one thing that has bothered me is that, occasionally*, ets:match throws a bad argument … And, from them on, all subsequent calls (even calls which previously worked) also throw a bad argument : > ets:match(Tid, { [$r | '$1'] }, 1). % this match works... % Then, at some point, this comes up: ** exception error: bad argument in function ets:match/3 called as ets:match(24589,{[114|'$1']},1) % And from then on, matches stop working: > ets:match(Tid, { [$r |

Why Erlang tuple module is controversial?

会有一股神秘感。 提交于 2019-12-19 06:37:53
问题 A similar question was asked Parameterised Modules in Erlang, it is about "what". My question is about "why"? OTP Technical Board - Decisions affecting R16 contains the board decision about this issue, but I don't know the reason behind the decision. Stateful Module in Programming Erlang 2ndEdition by Joe Armstrong introduces this feature in detail, but I don't see the author's attitude. If we read the official document Function Calls, we see this feature is deliberately skimmed. In fact, the

rebar: error exit on create-app: {crypto,start,[]}

*爱你&永不变心* 提交于 2019-12-19 06:05:39
问题 I followed the instructions here, to the letter. I then ran the instruction to create an application project structure, and got the following error. $ ./rebar create-app appid=myapp Uncaught error in rebar_core: {'EXIT', {undef, [{crypto,start,[]}, {rebar_core,run,1}, {rebar,main,1}, {escript,run,2}, {escript,start,1}, {init,start_it,1}, {init,start_em,1}]}} Any ideas what I'm doing wrong? 回答1: It looks like your Erlang was compiled without OpenSSL (the crypto module). crypto is required for

rebar: error exit on create-app: {crypto,start,[]}

隐身守侯 提交于 2019-12-19 06:05:16
问题 I followed the instructions here, to the letter. I then ran the instruction to create an application project structure, and got the following error. $ ./rebar create-app appid=myapp Uncaught error in rebar_core: {'EXIT', {undef, [{crypto,start,[]}, {rebar_core,run,1}, {rebar,main,1}, {escript,run,2}, {escript,start,1}, {init,start_it,1}, {init,start_em,1}]}} Any ideas what I'm doing wrong? 回答1: It looks like your Erlang was compiled without OpenSSL (the crypto module). crypto is required for