英文:
Is there any way to rgister multiple users in ejabberd?
问题
我需要在ejabberd中添加1万个用户。是否有一种方式可以批量注册多个用户在ejabberd中?
英文:
I have to add 10k users in ejabberd.Is there any way to rgister multiple users in ejabberd?
答案1
得分: 1
我假设你已经在ejabberd中配置了默认的身份验证方法:internal。
如果你已经将帐户存储在数据库中(LDAP、SQL或其他数据库),也许你可以将ejabberd连接到它们,而不是在内部ejabberd数据库中注册帐户?
或者你可以编写一个外部脚本,用任何编程语言检查帐户凭据是否与你的数据库匹配,并告诉ejabberd使用该脚本来检查帐户。
如果它们只是测试帐户,你可以使用一些注册工具,例如jab_simul,它只是注册帐户名称test_0001、test_0002等等。
如果你真的在ejabberd中使用内部身份验证方法,有两种注册方法:
A)使用XMPP中定义的In-Band Registration,使用XMPP客户端、XMPP机器人或XMPP库。
B)另一种方法是使用ejabberd提供的register API命令。
在命令行中调用此API的简单方法如下:
$ ejabberdctl register joe localhost somepAss
用户joe@localhost成功注册
但是,每次ejabberdctl启动一个小的erlang,所以对于注册10,000个帐户来说会非常慢。
查看其他调用ejabberd API的可能接口。
英文:
I asume you have in ejabberd configured the default authentication method: internal.
If you already have the accounts in a database (LDAP, SQL, other), maybe you can connect ejabberd to them, instead of registering the accounts in the internal ejabberd database?
Or you can write an external script in any language that checks account credentials against your database, and tell ejabberd to check accounts using that script.
If they are simply test accounts, you can use some registration tool, for example jab_simul that simply registers account names test_0001, test_0002, ...
If you really are using the internal authentication method in ejabberd, there are two ways to register it:
A) using In-Band Registration as defined in XMPP, using a XMPP client, XMPP bot or XMPP library.
B) Another method is to use the register API command provided by ejabberd.
An easy way to call this API is in the command line:
$ ejabberdctl register joe localhost somepAss
User joe@localhost successfully registered
However, ejabberdctl starts a small erlang each time, so that would be very slow for registering 10k accounts.
Check other possible interfaces to call ejabberd's API.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论