启动之后无法配置成功,数据库过不去,怎么初始化?不是知道创建的吗? (#4)
Unknown opened 4 years ago

docker run --name tigase-server -p 8080:8080 -p 5222:5222 tigase/tigase-xmpp-server:8.1.0

=====================
Could not initialize bean default (class: class tigase.db.beans.DataSourceBean$DataSourceMDConfigBean), skipping injection of this bean
RootCause:
   -> java.lang.reflect.InvocationTargetException
      [java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)]
      -> java.lang.RuntimeException: java.lang.RuntimeException: Could not initialize tigase.db.jdbc.DataRepositoryImpl for name 'default'
         [java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)]
         -> java.lang.RuntimeException: Could not initialize tigase.db.jdbc.DataRepositoryImpl for name 'default'
            [tigase.db.beans.MDPoolConfigBean.lambda$setInstances$0(MDPoolConfigBean.java:179)]
            -> tigase.db.DBInitException: Database initialization failed
               [tigase.db.jdbc.DataRepositoryImpl.initialize(DataRepositoryImpl.java:318)]
               -> com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
                  [java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)]
                  -> java.net.ConnectException: Connection refused (Connection refused)
                     [java.base/java.net.PlainSocketImpl.socketConnect(Native Method)]

始终不能初始化通过
要怎么设置数据库连接?

http://localhost:8080/setup 设置的内容为:

admins = [ 'admin@e1498daba259' ]
'config-type' = 'default'
debug = [ 'server' ]
'default-virtual-host' = 'e1498daba259'
dataSource () {
    default () {
        uri = 'jdbc:mysql://localhost:3306/tigasedb?user=root&password=123456&useSSL=false&useLegacyDatetimeCode=false&allowPublicKeyRetrieval=true'
    }
}
http () {
    setup () {
        'admin-password' = '1000'
        'admin-user' = '1000'
    }
}
pubsub () {
    trusted = [ 'http@{clusterNode}' ]
}
Unknown commented 4 years ago

不要使用localhost*(或:127.0.0.1)

Unknown commented 4 years ago

@HeroBarry please use English so more people can participate :-)

For people stumbling against this issue: the OP set up tigase-server in docker with database connection configured with localhost, which obviously is not provided within docker image.

Solution: use dedicated database instance (for example MySQL) and during setup provide it's hostname.

issue 1 of 1
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-xmpp-server-docker#4
Please wait...
Page is in error, reload to recover