使用MySQL进行ejabberd配置时出错

时间:2018-09-02 18:38:41

标签: mysql ejabberd

我尝试使用mariadb-server在Debian 9的VPS上安装ejabberd。

从aptitude(16.09-4)安装的ejabberd。

我指的是:https://docs.ejabberd.im/admin/databases/mysql/

我用以下命令下载了MySQL模式:wget https://raw.githubusercontent.com/processone/ejabberd/master/sql/mysql.sql

下面是我的ejabberd.yml conf文件:(我删除了所有以###开头的注释行)

loglevel: 4
log_rotate_size: 0
log_rotate_date: ""
log_rate_limit: 100
hosts:
  - "XXXXX.com"
  - "YYYYY.com"
  - "ZZZZZ.de"
listen: 
  - 
    port: 5222
    ip: "::"
    module: ejabberd_c2s
    certfile: "/etc/ejabberd/CCCCCCCCCCCCCCCCC.pem"
    starttls_required: true
    protocol_options:
      - "no_sslv3"
    max_stanza_size: 65536
    shaper: c2s_shaper
    access: c2s
    zlib: true
    resend_on_timeout: if_offline
  - 
    port: 5269
    ip: "::"
    module: ejabberd_s2s_in
  -
    port: 5281
    ip: "::"
    module: ejabberd_http
    web_admin: true
    http_bind: true
    tls: true
    certfile: "/etc/ejabberd/CCCCCCC.pem"
s2s_use_starttls: optional
s2s_certfile: "/etc/ejabberd/ejabberd.pem"
s2s_protocol_options:
  - "no_sslv3"
auth_password_format: scram
auth_method: sql
sql_type: mysql
sql_server: "localhost"
sql_database: "ejabberd"
sql_username: "MYNAME"
sql_password: "PASSWORD"
sql_port: 3306
shaper:
  normal: 1000
  fast: 50000
max_fsm_queue: 1000
acl:
  admin:
     user:
       - "MYNAME@localhost"
  local: 
    user_regexp: ""  
  loopback:
    ip:
      - "127.0.0.0/8"
shaper_rules:
  max_user_sessions: 10
  max_user_offline_messages:
    - 5000: admin
    - 100
  c2s_shaper:
    - none: admin
    - normal
  s2s_shaper: fast
access_rules:
  local:
    - allow: local
  c2s:
    - deny: blocked
    - allow
  announce:
    - allow: admin
  configure: 
    - allow: admin
  muc_create: 
    - allow: local
  pubsub_createnode: 
    - allow: local
  register: 
    - allow
  trusted_network: 
    - allow: loopback
language: "en"
modules:
  default_db: sql 
  mod_adhoc: {}
      mod_admin_extra: {}
  mod_announce: # recommends mod_adhoc
    access: announce
  mod_blocking: {} # requires mod_privacy
  mod_caps: {}
  mod_carboncopy: {}
  mod_client_state: {}
  mod_configure: {} # requires mod_adhoc
  mod_disco: {}
  mod_echo: {}
  mod_irc: {}
  mod_http_bind: {}
  mod_last: {}
  mod_muc: 
    access:
      - allow
    access_admin:
      - allow: admin
    access_create: muc_create
    access_persistent: muc_create
  mod_muc_admin: {}
  mod_offline: 
    access_max_user_messages: max_user_offline_messages
  mod_ping: {}
  mod_privacy: {}
  mod_private: {}
  mod_pubsub: 
    access_createnode: pubsub_createnode
    ignore_pep_from_offline: true
    last_item_cache: false
    plugins: 
      - "flat"
      - "hometree"
      - "pep" # pep requires mod_caps
  mod_roster:
    versioning: true
  mod_shared_roster: {}
  mod_stats: {}
  mod_time: {}
  mod_vcard:
    search: false
  mod_version: {}
allow_contrib_modules: true

按照文档中的要求,它在编辑SQL部件后停止工作: auth_password_format: scram auth_method: sql sql_type: mysql sql_server: "localhost" sql_database: "ejabberd" sql_username: "MYNAME" sql_password: "PASSWORD" sql_port: 3306

当然已加载架构。

在再次启动ejabberd时,ejabberd.log中的此报告失败了:感谢您的帮助或提示,以解决此问题...

  

2018-09-02 20:24:29.684 [info] <0.31.0>在节点ejabberd @ vps574962上启动了应用程序lager
  2018-09-02 20:24:29.692 [info] <0.31.0>在节点ejabberd @ vps574962上启动应用程序加密
  2018-09-02 20:24:29.696 [info] <0.31.0>在节点ejabberd @ vps574962上启动了应用程序sasl
  2018-09-02 20:24:29.702 [info] <0.31.0>在节点ejabberd @ vps574962上启动了应用程序asn1
  2018-09-02 20:24:29.703 [info] <0.31.0>在节点ejabberd @ vps574962上启动了应用程序public_key
  2018-09-02 20:24:29.708 [info] <0.31.0>在节点ejabberd @ vps574962上启动应用程序ssl
  2018-09-02 20:24:29.713 [info] <0.31.0>在节点ejabberd @ vps574962上启动了应用程序fast_yaml
  2018-09-02 20:24:29.723 [信息] <0.31.0>应用程序fast_tls在节点ejabberd @ vps574962上启动
  2018-09-02 20:24:29.729 [info] <0.31.0>在节点ejabberd @ vps574962上启动了应用程序fast_xml
  2018-09-02 20:24:29.735 [info] <0.31.0>在节点ejabberd @ vps574962上启动了应用程序stringprep
  2018-09-02 20:24:29.739 [info] <0.31.0>在节点ejabberd @ vps574962上启动了应用程序cache_tab
  2018-09-02 20:24:29.834 [info] <0.31.0>应用程序mnesia在节点ejabberd @ vps574962上启动
  2018-09-02 20:24:30.228 [info] <0.31.0>应用程序inets在节点ejabberd @ vps574962上启动
  2018-09-02 20:24:30.245 [错误] <0.61.0>崩溃报告进程<0.61.0>,其中0个邻居退出,原因:没有匹配函数的子句列表:application_master中的map(#Fun,sql)第1238行:init / 4行134
  2018-09-02 20:24:30.245 [info] <0.31.0>应用程序ejabberd退出原因是:没有匹配列表的函数子句:map(#Fun,sql)1238行

1 个答案:

答案 0 :(得分:0)

尝试在ejabberd.yml中修复以下缩进

来自

    mod_version: {}
allow_contrib_modules: true

allow_contrib_modules:是

  mod_version: {}
    allow_contrib_modules: true