Closed juancar0505 closed 3 years ago
I haven't checked your files, because I prefer mi solution. I have a way to setup ejabberd, mysql, create the database, fill with example accounts, and setup MySQL web administration service. Try my example, and adapt it to your needs.
hosts:
- localhost
- mysql.localhost
host_config:
mysql.localhost:
sql_port: 3306
sql_type: mysql
sql_server: "mysql"
sql_database: "ejabberd_test"
sql_username: "ejabberd_test"
sql_password: "ejabberd_test"
sql_pool_size: 1
auth_method: sql
default_db: sql
Download ejabberd's mysql.sql file, as it will be used to prepare the database.
Start docker-compose. It takes several minutes to fully start MySQL, be patient
sudo docker-compose up
Creating network "ecs_default" with the default driver
Creating volume "main_conf" with default driver
Creating volume "main_logs" with default driver
Creating volume "main_data" with default driver
Creating volume "main_uplo" with default driver
Creating volume "mysql_data" with default driver
Creating mysql ... done
Creating main ... done
Creating adminer ... done
Attaching to mysql, main, adminer
...
main | 2021-05-13 10:23:54.208771+00:00 [info] ejabberd 21.4.0 is started in the node ejabberd@main in 11.25s
main | 2021-05-13 10:23:54.215446+00:00 [info] Start accepting TCP connections at [::]:5269 for ejabberd_s2s_in
main | 2021-05-13 10:23:54.216246+00:00 [info] Start accepting TLS connections at [::]:5443 for ejabberd_http
main | 2021-05-13 10:23:54.216604+00:00 [info] Start accepting TCP connections at [::]:5280 for ejabberd_http
main | 2021-05-13 10:23:54.217225+00:00 [info] Start accepting TCP connections at [::]:1883 for mod_mqtt
main | 2021-05-13 10:23:54.217693+00:00 [info] Start accepting TCP connections at [::]:5222 for ejabberd_c2s
main | 2021-05-13 10:23:54.218102+00:00 [warning] No HTTP listeners for ACME challenges are configured, automatic certificate requests are aborted. Hint: configure the listener and restart/reload ejabberd. Or set acme->auto option to `false` to suppress this warning.
main | 2021-05-13 10:23:54.235688+00:00 [info] Start accepting TCP connections at 172.21.0.3:7777 for mod_proxy65_stream
main | :> ejabberdctl register admin localhost asd
main | User admin@localhost successfully registered
main | :> ejabberdctl register user1my mysql.localhost asd
main | User user1my@mysql.localhost successfully registered
main | :> ejabberdctl stats registeredusers
main | 2
main | :> ejabberdctl status
main | The node ejabberd@main is started with status: started
main | ejabberd 21.4.0 is running in that node
admin@localhost
and password: asd
I m trying to execute this but its appear this error ... I dowoload mysql.sql file and i have it in the same proyect. The files that i have in my proyect are ejabberd.yml, mysql.sql and docker-compose.yml. I need something more ?
ERROR: Named volume "mysql.sql:/docker-entrypoint-initdb.d:rw" is used in service "mysql" but no declaration was found in the volumes section.
ERROR: Named volume "mysql.sql:/docker-entrypoint-initdb.d:rw" is used in service "mysql" but no declaration was found in the volumes section.
Ah, right, instead of - mysql.sql
it should be - ./mysql.sql
I've updated my example for mysql.sql and also for ejabberd.yml
The files that i have in my proyect are ejabberd.yml, mysql.sql and docker-compose.yml.
Right, those three files in the same directory, they should be enough.
Im trying to use mysql database on ejabberd with docker-compose.
My configuration file is this:
I clarify that my dockerfile from the mysql_ejabberd image is the following, only create the database of ejabberd:
I dont know if i need to add something on my .yml or dockerfile Can u someone help me pls?