
The configuration mechanism consists of the following concepts: Specification Specifies the available configuration parameters of a module, their names and their types. Param Specifies a parameter, its name and its type. Type Specifies the type of a configuration parameters; Bool, Size, Count, etc. Configuration Specifies the configuration values of a particular instance of the module. Configuration walks hand in hand with Specification, the latter specifies what the former should contain. A Specification is capable of configuring a Configuration from a MXS_CONFIG_PARAMETER, checking in the process that all parameters are of the correct type and that the required parameters are present. A Specification is capable of persisting itself so that it later can be read back. The mechanism is closed for modification but open for extension in the sense that if a module requires a custom parameter, all it needs to do is to derive one class from Param and another from Type. The canonical way for using this mechanism is as follows. Consider a module xyx that has three parameters; a parameter called "enabled" that is of boolean type, a parameter called "period" that is of duration type, and a parameter "cache" that is of size type. That would be declared as follows: // xyz.hh class XYZSession; class XYZ : public maxscale::Filter<XYZ, XYZSession> { public: static XYZ* create(const char* zName, MXS_CONFIG_PARAMETER* pParams); private: XYZ(); static config::Specification s_specification; static config::ParamBool s_enabled; static config::ParamDuration<std::chrono::seconds> s_period; static config::ParamSize s_cache; config::Configuration m_configuration; config::Bool m_enabled; config::Duration<std::chrono::seconds> m_period; config::Size m_cache; }; // xyz.cc config::Specification XYZ::s_specification(MXS_MODULE_NAME); config::ParamBool XYZ::s_enabled( &s_specification, "enabled", "Specifies whether ... should be enabled or not." ); config::ParamDuration<std::chrono::seconds> XYZ::s_period( &s_specification, "period", "Specifies the period. Rounded to the nearest second." ); config::ParamSize XYZ::s_cache( &s_specification, "cache", "Specifies the size of the internal cache." ); XYZ::XYZ() : m_configuration(&s_specification) , m_enabled(&m_configuration, &s_enabled) , m_period(&m_configuration, &s_period) , m_cache(&m_configuration, &s_cache) { } XYZ* XYZ::create(const char* zName, MXS_CONFIG_PARAMETER* pParams) { XYZ* pXyz = new XYZ; if (!s_specification.configure(pXyz->m_configuration, pParams)) { delete pXyz; pXyz = nullptr; } return pXyz; }
MaxScale by MariaDB Corporation
The MariaDB Corporation MaxScale is an intelligent proxy that allows forwarding of database statements to one or more database servers using complex rules, a semantic understanding of the database statements and the roles of the various servers within the backend cluster of databases.
MaxScale is designed to provide load balancing and high availability functionality transparently to the applications. In addition it provides a highly scalable and flexible architecture, with plugin components to support different protocols and routing decisions.
For a detailed overview of what MaxScale can do, read the MaxScale page on the MariaDB website.
An Google Group exists for MaxScale that can be used to discuss ideas, issues and communicate with the MaxScale community.
We're also on the #maria and #maxscale channels on FreeNode.
Please report all feature requests, improvements and bugs in the MariaDB Jira.
Getting Started
Read the Documentation Overview for a list of all MaxScale documents.
Documentation
The official documentation can be found on the MariaDB Knowledge Base.
A MaxScale Troubleshooting Guide can be found on the MariaDB Knowledgebase. It answers common questions encountered when installing and using MaxScale.
The documentation can also be found in the Documentation directory of the source tree.
Contributing Code
Read the Contributing page on the wiki for more information on how to do pull request and where to do them.