From e3e4fd31c44ff015ae95f43486a6fa6b7952e47d Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Fri, 17 Nov 2023 13:53:11 +0100 Subject: [PATCH 1/2] Rename db and node to mongooseim --- .circleci/template.yml | 6 +++--- big_tests/test.config | 12 ++++++------ doc/developers-guide/Testing-MongooseIM.md | 5 +++++ rel/files/cets_disco.txt | 2 +- test/common/config_parser_helper.erl | 8 ++++---- test/config_parser_SUITE_data/mongooseim-pgsql.toml | 4 ++-- test/config_parser_SUITE_data/outgoing_pools.toml | 4 ++-- tools/docker-setup-postgres.sh | 6 +++--- tools/install_odbc_ini.sh | 2 +- tools/open-test-database-shell.sh | 8 ++++---- tools/setup-db.sh | 6 +++--- tools/ssl/openssl-mongooseim.cnf | 10 +++++----- 12 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.circleci/template.yml b/.circleci/template.yml index ded4e2b629..10f3244d42 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -16,8 +16,8 @@ containers: environment: - SQL_TEMP_DIR: /tmp/sql - MYSQL_ROOT_PASSWORD: secret - - MYSQL_DATABASE: ejabberd - - MYSQL_USER: ejabberd + - MYSQL_DATABASE: mongooseim + - MYSQL_USER: mongooseim - MYSQL_PASSWORD: mongooseim_secret - OLD_ENTRYPOINT: "./entrypoint.sh mysqld" - ENV_FILE_CFG_PATH: "/etc/mysql/conf.d/mysql.cnf" @@ -80,7 +80,7 @@ containers: environment: - ACCEPT_EULA: Y - SA_PASSWORD: "mongooseim_secret+ESL123" - - DB_NAME: ejabberd + - DB_NAME: mongooseim - SCHEMA_READY_PORT: 1434 # We are not running as root in this container, # so we can only write into some directories (in this case, /tmp) diff --git a/big_tests/test.config b/big_tests/test.config index 42b798fc70..146330079e 100644 --- a/big_tests/test.config +++ b/big_tests/test.config @@ -258,8 +258,8 @@ workers = 5 connection.driver = \"pgsql\" connection.host = \"localhost\" - connection.database = \"ejabberd\" - connection.username = \"ejabberd\" + connection.database = \"mongooseim\" + connection.username = \"mongooseim\" connection.password = \"mongooseim_secret\" connection.tls.required = true connection.tls.cacertfile = \"priv/ssl/cacert.pem\" @@ -279,8 +279,8 @@ workers = 5 connection.driver = \"pgsql\" connection.host = \"localhost\" - connection.database = \"ejabberd\" - connection.username = \"ejabberd\" + connection.database = \"mongooseim\" + connection.username = \"mongooseim\" connection.password = \"mongooseim_secret\" connection.tls.required = true connection.tls.cacertfile = \"priv/ssl/cacert.pem\" @@ -321,8 +321,8 @@ workers = 5 connection.driver = \"mysql\" connection.host = \"localhost\" - connection.database = \"ejabberd\" - connection.username = \"ejabberd\" + connection.database = \"mongooseim\" + connection.username = \"mongooseim\" connection.password = \"mongooseim_secret\" connection.tls.cacertfile = \"priv/ssl/cacert.pem\" connection.tls.versions = [\"tlsv1.2\", \"tlsv1.3\"]"}, diff --git a/doc/developers-guide/Testing-MongooseIM.md b/doc/developers-guide/Testing-MongooseIM.md index 239002d68c..ee52e3abcf 100644 --- a/doc/developers-guide/Testing-MongooseIM.md +++ b/doc/developers-guide/Testing-MongooseIM.md @@ -206,6 +206,11 @@ cd $MONGOOSEIM make devrel ``` +If databases are needed, for example PostgreSQL, you can run: +```sh +DB="pgsql" ./tools/setup-db.sh +``` + In shell #2: ```sh diff --git a/rel/files/cets_disco.txt b/rel/files/cets_disco.txt index 428fc58a86..62a3b1fe30 100644 --- a/rel/files/cets_disco.txt +++ b/rel/files/cets_disco.txt @@ -1,3 +1,3 @@ mongooseim@localhost -ejabberd2@localhost +mongooseim2@localhost mongooseim3@localhost diff --git a/test/common/config_parser_helper.erl b/test/common/config_parser_helper.erl index c585018de7..bf4a2eacd7 100644 --- a/test/common/config_parser_helper.erl +++ b/test/common/config_parser_helper.erl @@ -246,8 +246,8 @@ options("mongooseim-pgsql") -> fun pool_config/1, [#{type => rdbms, opts => #{workers => 5}, - conn_opts => #{driver => pgsql, host => "localhost", port => 5432, database => "ejabberd", - username => "ejabberd", password => "mongooseim_secret", + conn_opts => #{driver => pgsql, host => "localhost", port => 5432, database => "mongooseim", + username => "mongooseim", password => "mongooseim_secret", tls => #{required => true, cacertfile => "priv/ca.pem", server_name_indication => #{enabled => false}} @@ -347,8 +347,8 @@ options("outgoing_pools") -> #{type => rdbms, opts => #{workers => 5}, conn_opts => #{query_timeout => 5000, keepalive_interval => 30, - driver => pgsql, host => "localhost", port => 5432, database => "ejabberd", - username => "ejabberd", password => "mongooseim_secret", + driver => pgsql, host => "localhost", port => 5432, database => "mongooseim", + username => "mongooseim", password => "mongooseim_secret", tls => #{required => true, cacertfile => "priv/ca.pem", server_name_indication => #{enabled => false}} diff --git a/test/config_parser_SUITE_data/mongooseim-pgsql.toml b/test/config_parser_SUITE_data/mongooseim-pgsql.toml index 121338458e..78b5f2e0ed 100644 --- a/test/config_parser_SUITE_data/mongooseim-pgsql.toml +++ b/test/config_parser_SUITE_data/mongooseim-pgsql.toml @@ -141,8 +141,8 @@ [outgoing_pools.rdbms.default.connection] driver = "pgsql" host = "localhost" - database = "ejabberd" - username = "ejabberd" + database = "mongooseim" + username = "mongooseim" password = "mongooseim_secret" tls.required = true tls.cacertfile = "priv/ca.pem" diff --git a/test/config_parser_SUITE_data/outgoing_pools.toml b/test/config_parser_SUITE_data/outgoing_pools.toml index 680284c9a4..f10d90c45d 100644 --- a/test/config_parser_SUITE_data/outgoing_pools.toml +++ b/test/config_parser_SUITE_data/outgoing_pools.toml @@ -18,8 +18,8 @@ [outgoing_pools.rdbms.default.connection] driver = "pgsql" host = "localhost" - database = "ejabberd" - username = "ejabberd" + database = "mongooseim" + username = "mongooseim" password = "mongooseim_secret" keepalive_interval = 30 tls.required = true diff --git a/tools/docker-setup-postgres.sh b/tools/docker-setup-postgres.sh index 042b9ed437..a0acc22658 100755 --- a/tools/docker-setup-postgres.sh +++ b/tools/docker-setup-postgres.sh @@ -16,7 +16,7 @@ cp ${SQL_TEMP_DIR}/pg_hba.conf ${PGSQLDIR}/. cp ${SQL_TEMP_DIR}/pg.sql ${PGSQLDIR}/. # Configuring postgres -psql -U postgres -c "CREATE ROLE ejabberd PASSWORD 'mongooseim_secret' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;" -psql -U postgres -c "CREATE DATABASE ejabberd;" +psql -U postgres -c "CREATE ROLE mongooseim PASSWORD 'mongooseim_secret' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;" +psql -U postgres -c "CREATE DATABASE mongooseim;" # Creating schema -psql -U postgres -q -d ejabberd -f ${PGSQLDIR}/pg.sql +psql -U postgres -q -d mongooseim -f ${PGSQLDIR}/pg.sql diff --git a/tools/install_odbc_ini.sh b/tools/install_odbc_ini.sh index 3fe64905b0..585b391e69 100755 --- a/tools/install_odbc_ini.sh +++ b/tools/install_odbc_ini.sh @@ -46,7 +46,7 @@ Setup = $ODBC_SETUP Driver = $ODBC_DRIVER Server = 127.0.0.1 Port = $MSSQL_PORT -Database = ejabberd +Database = mongooseim Username = sa Password = mongooseim_secret+ESL123 Charset = UTF-8 diff --git a/tools/open-test-database-shell.sh b/tools/open-test-database-shell.sh index 0a291dae8b..6069512141 100755 --- a/tools/open-test-database-shell.sh +++ b/tools/open-test-database-shell.sh @@ -6,16 +6,16 @@ db=$1 case $db in mysql) - $DOCKER exec -e MYSQL_PWD=secret -it mongooseim-mysql mysql -h localhost -u root -D ejabberd + $DOCKER exec -e MYSQL_PWD=secret -it mongooseim-mysql mysql -h localhost -u root -D mongooseim ;; pgsql) - $DOCKER exec -e PGPASSWORD=password -it mongooseim-pgsql psql -U postgres -d ejabberd -h 127.0.0.1 + $DOCKER exec -e PGPASSWORD=password -it mongooseim-pgsql psql -U postgres -d mongooseim -h 127.0.0.1 ;; mssql-sqlcmd) - $DOCKER exec -it mongooseim-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P mongooseim_secret+ESL123 -d ejabberd + $DOCKER exec -it mongooseim-mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P mongooseim_secret+ESL123 -d mongooseim ;; mssql) - $DOCKER run --link mongooseim-mssql -it --rm shellmaster/sql-cli mssql --server mongooseim-mssql --user sa --pass mongooseim_secret+ESL123 --database ejabberd + $DOCKER run --link mongooseim-mssql -it --rm shellmaster/sql-cli mssql --server mongooseim-mssql --user sa --pass mongooseim_secret+ESL123 --database mongooseim ;; *) echo "Unknown argument $db" diff --git a/tools/setup-db.sh b/tools/setup-db.sh index 57cc521760..51198e52f6 100755 --- a/tools/setup-db.sh +++ b/tools/setup-db.sh @@ -49,8 +49,8 @@ function setup_db(){ -p $MYSQL_PORT:3306 \ -e SQL_TEMP_DIR=/tmp/sql \ -e MYSQL_ROOT_PASSWORD=secret \ - -e MYSQL_DATABASE=ejabberd \ - -e MYSQL_USER=ejabberd \ + -e MYSQL_DATABASE=mongooseim \ + -e MYSQL_USER=mongooseim \ -e MYSQL_PASSWORD=mongooseim_secret \ -e OLD_ENTRYPOINT="./entrypoint.sh mysqld" \ -e ENV_FILE_CFG_PATH="/etc/mysql/conf.d/mysql.cnf" \ @@ -240,7 +240,7 @@ function setup_db(){ --user root \ -e "ACCEPT_EULA=Y" \ -e "SA_PASSWORD=mongooseim_secret+ESL123" \ - -e "DB_NAME=ejabberd" \ + -e "DB_NAME=mongooseim" \ -e "SQL_FILE=/tmp/mongoose.sql" \ -e SCHEMA_READY_PORT=1434 \ -e SQL_FILE="/tmp/mongoose.sql" \ diff --git a/tools/ssl/openssl-mongooseim.cnf b/tools/ssl/openssl-mongooseim.cnf index 995c1153ce..dc51a3778d 100644 --- a/tools/ssl/openssl-mongooseim.cnf +++ b/tools/ssl/openssl-mongooseim.cnf @@ -32,9 +32,9 @@ DNS.1 = localhost ##adding node names to let tls distribution with OTP 20.3 DNS.2 = mongooseim@localhost -DNS.3 = ejabberd2@localhost -DNS.4 = fed1@localhost -DNS.5 = reg1@localhost -DNS.6 = mongooseim3@localhost +DNS.3 = mongooseim2@localhost +DNS.4 = mongooseim3@localhost +DNS.5 = fed1@localhost +DNS.6 = reg1@localhost -IP = 127.0.0.1 \ No newline at end of file +IP = 127.0.0.1 From d18a4d797260e807b5bbc17da7778923cd5b3799 Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Fri, 17 Nov 2023 13:54:55 +0100 Subject: [PATCH 2/2] Remove old reference to ejabberd_c2s in metrics --- doc/operation-and-maintenance/MongooseIM-metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/operation-and-maintenance/MongooseIM-metrics.md b/doc/operation-and-maintenance/MongooseIM-metrics.md index e7610ebf38..cf8a84ccc7 100644 --- a/doc/operation-and-maintenance/MongooseIM-metrics.md +++ b/doc/operation-and-maintenance/MongooseIM-metrics.md @@ -155,7 +155,7 @@ Metrics specific to an extension, e.g. Message Archive Management, are described | `[global, nodeUpTime]` | value | Node uptime. | | `[global, clusterSize]` | value | A number of nodes in a MongooseIM cluster seen by a given MongooseIM node (based on Mnesia). For CETS use `global.cets.system.joined_nodes` instead. | | `[global, tcpPortsUsed]` | value | A number of open tcp connections. This should relate to the number of connected sessions and databases, as well as federations and http requests, in order to detect connection leaks. | -| `[global, processQueueLengths]` | probe | The number of queued messages in the internal message queue of every erlang process, and the internal queue of every fsm (ejabberd\_c2s). This is sampled every 30 seconds asynchronously. It is a good indicator of an overloaded system: if too many messages are queued at the same time, the system is not able to process the data at the rate it was designed for. | +| `[global, processQueueLengths]` | probe | The number of queued messages in the internal message queue of every erlang process, and the internal queue of every fsm (ejabberd\_s2s). This is sampled every 30 seconds asynchronously. It is a good indicator of an overloaded system: if too many messages are queued at the same time, the system is not able to process the data at the rate it was designed for. | ### Data metrics