-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📖 Document CETS as an alternative to Mnesia #4130
Conversation
Add information to User’s Guide / Tutorials how to set up MIM with RDBMS + CETS. Update all docs relying on Mnesia configuration and commands like running_db_nodes to also show the CETS alternatives. Uses tabs in documentation.
elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 46c6b6e small_tests_24 / small_tests / 46c6b6e small_tests_25 / small_tests / 46c6b6e small_tests_25_arm64 / small_tests / 46c6b6e ldap_mnesia_24 / ldap_mnesia / 46c6b6e ldap_mnesia_25 / ldap_mnesia / 46c6b6e dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 46c6b6e dynamic_domains_mysql_redis_25 / mysql_redis / 46c6b6e dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 46c6b6e dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 46c6b6e internal_mnesia_25 / internal_mnesia / 46c6b6e mysql_redis_25 / mysql_redis / 46c6b6e pgsql_mnesia_24 / pgsql_mnesia / 46c6b6e pgsql_cets_25 / pgsql_cets / 46c6b6e pgsql_mnesia_25 / pgsql_mnesia / 46c6b6e mssql_mnesia_25 / odbc_mssql_mnesia / 46c6b6e |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4130 +/- ##
=======================================
Coverage 83.94% 83.95%
=======================================
Files 553 553
Lines 33661 33661
=======================================
+ Hits 28257 28259 +2
+ Misses 5404 5402 -2 ☔ View full report in Codecov by Sentry. |
doc/tutorials/CETS-configure.md
Outdated
[CETS](https://github.com/esl/cets/) is a library, which allows to replicate in-memory data | ||
across the MongooseIM cluster. It could be used to store a list of online XMPP sessions, a list | ||
of outgoung S2S connections, steam management session IDs, a list of online MUC rooms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to say "a set" instead of "a list", as the term list already has a very specific meaning in Erlang that is not what we're really storing here. But maybe this is not important, dunno, what do other devs think? 🤔
doc/tutorials/CETS-configure.md
Outdated
|
||
If you want to use CETS instead of Mnesia, ensure that these options are set: | ||
|
||
```ini |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, markdown recognises toml here, it can be
```ini | |
```toml |
* CETS - a library to synchronise records from the ETS tables between nodes. | ||
A new choice to share the live data across the MongooseIM cluster. | ||
We recommend to use this backend for transient data. | ||
This backend requires an RDBMS database configured because we use an external database to discover nodes in the cluster. | ||
Check for CETS config example in [tutorials](../tutorials/CETS-configure.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* CETS - a library to synchronise records from the ETS tables between nodes. | |
A new choice to share the live data across the MongooseIM cluster. | |
We recommend to use this backend for transient data. | |
This backend requires an RDBMS database configured because we use an external database to discover nodes in the cluster. | |
Check for CETS config example in [tutorials](../tutorials/CETS-configure.md). | |
* CETS - a library to synchronise ETS tables between nodes. | |
A new choice to share live data across the MongooseIM cluster. | |
We recommend to use this backend for transient data. | |
This backend requires an RDBMS database configured because we use an external database to discover nodes in the cluster. | |
For a CETS config example, see [tutorials](../tutorials/CETS-configure.md). |
* Mnesia - a built-in Erlang Database. | ||
Mnesia is fine for the cluster of the fixed size with reliable networking between nodes and with nodes rarely restarted. | ||
There are some issues when nodes are restarting or joining the cluster. So, we recommend to use CETS instead. | ||
Mnesia is still a default backend for modules for config compatibility reasons. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Mnesia - a built-in Erlang Database. | |
Mnesia is fine for the cluster of the fixed size with reliable networking between nodes and with nodes rarely restarted. | |
There are some issues when nodes are restarting or joining the cluster. So, we recommend to use CETS instead. | |
Mnesia is still a default backend for modules for config compatibility reasons. | |
* Mnesia - a built-in Erlang Database. | |
Mnesia is fine for a cluster of fixed size with reliable networking between nodes and with nodes rarely restarted. | |
There are some issues when nodes are restarting or new ones joining the cluster. For this case, we recommend to use CETS instead. | |
Mnesia is still the default backend for some modules for compatibility reasons with older config files. |
mongooseimctl leave_cluster | ||
``` | ||
Stopping the node is enough to leave the cluster. | ||
If you want to avoid the node to join the cluster again, you have to specify a different `cluster_name` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to avoid the node to join the cluster again, you have to specify a different `cluster_name` | |
If you want to avoid the node joining the cluster again, you have to specify a different `cluster_name` |
```text | ||
The node mongooseim2@localhost has successfully left the cluster | ||
``` | ||
It only makes sense to use it if the node is the part of a cluster, e.g `join_cluster` was called from that node before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only makes sense to use it if the node is the part of a cluster, e.g `join_cluster` was called from that node before. | |
It only makes sense to use it if the node is part of a cluster, e.g `join_cluster` was called on that node before. |
```bash | ||
mongooseimctl mnesia info | grep "stopped db nodes" | ||
``` | ||
where `RemoteNodeName` is a name of the node that we'd like to remove from our cluster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where `RemoteNodeName` is a name of the node that we'd like to remove from our cluster. | |
where `RemoteNodeName` is the name of the node that we'd like to remove from our cluster. |
You can check `unavailableNodes`, `remoteNodesWithUnknownTables`, | ||
`remoteNodesWithMissingTables` lists for more information (generally, these lists should be empty). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can check `unavailableNodes`, `remoteNodesWithUnknownTables`, | |
`remoteNodesWithMissingTables` lists for more information (generally, these lists should be empty). | |
You can check the `unavailableNodes`, `remoteNodesWithUnknownTables`, | |
and `remoteNodesWithMissingTables` lists for more information (generally, these lists should be empty). |
```bash | ||
running db nodes = [mongooseim@node1, mongooseim@node2] | ||
``` | ||
To see stopped or misbehaving nodes following command can be useful: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To see stopped or misbehaving nodes following command can be useful: | |
To see stopped or misbehaving nodes the following command can be useful: |
elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / df1d1a9 small_tests_24 / small_tests / df1d1a9 small_tests_25_arm64 / small_tests / df1d1a9 small_tests_25 / small_tests / df1d1a9 ldap_mnesia_24 / ldap_mnesia / df1d1a9 ldap_mnesia_25 / ldap_mnesia / df1d1a9 dynamic_domains_mysql_redis_25 / mysql_redis / df1d1a9 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / df1d1a9 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / df1d1a9 service_mongoose_system_metrics_SUITE:module_opts:module_opts_are_reported{error,
{{assertEqual,
[{module,service_mongoose_system_metrics_SUITE},
{line,370},
{expression,
"is_module_opt_reported ( atom_to_binary ( Module ) , Key , Value )"},
{expected,true},
{value,false}]},
[{service_mongoose_system_metrics_SUITE,check_module_opt,3,
[{file,
"/home/circleci/project/big_tests/tests/service_mongoose_system_metrics_SUITE.erl"},
{line,370}]},
{service_mongoose_system_metrics_SUITE,module_opts_are_reported,1,
[{file,
"/home/circleci/project/big_tests/tests/service_mongoose_system_metrics_SUITE.erl"},
{line,222}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} pgsql_cets_25 / pgsql_cets / df1d1a9 internal_mnesia_25 / internal_mnesia / df1d1a9 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / df1d1a9 mysql_redis_25 / mysql_redis / df1d1a9 pgsql_mnesia_25 / pgsql_mnesia / df1d1a9 pgsql_mnesia_24 / pgsql_mnesia / df1d1a9 mssql_mnesia_25 / odbc_mssql_mnesia / df1d1a9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But it'd be good someone else also reviews, if only to check if any information is missing. The one already here seems very good to me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - only minor comments from me.
doc/operation-and-maintenance/Cluster-configuration-and-node-management.md
Outdated
Show resolved
Hide resolved
elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 4b8a0ca small_tests_24 / small_tests / 4b8a0ca small_tests_25_arm64 / small_tests / 4b8a0ca small_tests_25 / small_tests / 4b8a0ca ldap_mnesia_24 / ldap_mnesia / 4b8a0ca dynamic_domains_mysql_redis_25 / mysql_redis / 4b8a0ca dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 4b8a0ca dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 4b8a0ca ldap_mnesia_25 / ldap_mnesia / 4b8a0ca dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 4b8a0ca internal_mnesia_25 / internal_mnesia / 4b8a0ca pgsql_cets_25 / pgsql_cets / 4b8a0ca mysql_redis_25 / mysql_redis / 4b8a0ca mssql_mnesia_25 / odbc_mssql_mnesia / 4b8a0ca pgsql_mnesia_25 / pgsql_mnesia / 4b8a0ca pgsql_mnesia_24 / pgsql_mnesia / 4b8a0ca |
This PR addresses MIM-1995.
Proposed changes include: