在启动时同步 ejabberd 节点

发布于 2024-07-30 12:21:55 字数 571 浏览 2 评论 0原文

我遇到了一个似乎无法解决的问题。 我需要传入函数 mnesia:change_table_copy_type(schema,node(),disc_copies)。 在命令行中从主节点创建数据库。 erl 启动为: erl -name NODE1 -mnesia extra_db_nodes \"['MASTER']\" -s mnesia 当我启动 shell 然后输入函数调用时,一切正常,然后我可以停止 shell 并正常启动 ejabber 进程。 所以我需要的是一种脚本化方法来完成数据库设置和同步。

我尝试了许多不同的方法来获取传入的change_table_copy_type,但没有成功。 最终目标是能够编写启动 mnesia 的过程的脚本,传入函数,然后退出 shell。 有人尝试过这个吗? 我尝试过重定向,例如: erl -name NODE1 -mnesia extra_db_nodes \"['MASTER']\" -s mnesia <

由于传入函数调用时节点未启动,因此此操作失败。 我尝试使用“-run”选项,但得到并错误告诉我该函数是 undef。 也许我没有正确构建 -run 部分。

I am running into an issue that appears to be un-resolvable.
I have a need to pass in the function mnesia:change_table_copy_type(schema, node(), disc_copies). at the command line whe the db is created from the master node.
the erl start is: erl -name NODE1 -mnesia extra_db_nodes \"['MASTER']\" -s mnesia
When I start the shell then enter the function call everything works fine and I can then stop the shell and start the ejabber process normally. So what I need is a scripted method to get the DB setup and sync done.

I have tried many different methods to get the change_table_copy_type passed in with no success. the end goal is to be able to script the process of starting mnesia, pass in the function, and then quit out of the shell.
Has anyone even tried this? I have tried redirects such as:
erl -name NODE1 -mnesia extra_db_nodes \"['MASTER']\" -s mnesia <

This fails as the node is not started when the function call is passed in.
I have tried using the "-run" option but get and error telling me the function is undef.
Maybe I am not constructing the -run section correctly.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

红焚 2024-08-06 12:21:55

尝试 erl 的 -eval 参数:

erl -name NODE1 -mnesia extra_db_nodes "['MASTER']" -eval 'mnesia:start(), mnesia:change_table_copy_type(schema, node(), disc_copies), init:stop()'

可能需要在某处使用 mnesia:wait_for_tables 以确保在执行 change_table_copy_type< 之前有时间加入集群/代码>。

Try the -eval argument for erl:

erl -name NODE1 -mnesia extra_db_nodes "['MASTER']" -eval 'mnesia:start(), mnesia:change_table_copy_type(schema, node(), disc_copies), init:stop()'

That might need an mnesia:wait_for_tables in there somewhere to ensure that it has time to join the cluster before doing the change_table_copy_type.

往日情怀 2024-08-06 12:21:55

从 ejabberd 15.05 开始,ejabberd 附带了一个新命令来简化集群部署和设置:ejabberdctl join_cluster

该命令记录在 ejabberd 文档中:ejabberd 聚类

这应该可以帮助您确保集群已正确配置为启动 ejabberd 的标准方法。

Since ejabberd 15.05, ejabberd comes with a new command to ease cluster deployment and setup: ejabberdctl join_cluster

The command is documented in ejabberd documentation: ejabberd clustering.

This should help you make sure the cluster is properly configured with the standard way to launch ejabberd.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文