在启动时同步 ejabberd 节点
我遇到了一个似乎无法解决的问题。 我需要传入函数 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试 erl 的 -eval 参数:
可能需要在某处使用
mnesia:wait_for_tables
以确保在执行change_table_copy_type< 之前有时间加入集群/代码>。
Try the
-eval
argument for erl:That might need an
mnesia:wait_for_tables
in there somewhere to ensure that it has time to join the cluster before doing thechange_table_copy_type
.从 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.