28

Support for Admin Interface in MySQL server

 5 years ago
source link: https://www.tuicool.com/articles/hit/BNvyi2A
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

For some time, there have been several requests to the MySQL dev team to add dedicated support for an admin to connect to the MySQL server.  We received a contribution from Facebook, bug#90395 ,  to add this functionality, which we then paired with more requirements, implemented in WL#12138 and delivered in MySQL Server 8.0.14. Many thanks to Facebook for their contribution!

When we started work to provide this functionality we implemented an Admin Interface which is a host/port pair that listens to incoming TCP connections. Other requirements for the implementation were

  • communication over the classic MySQL protocol
  • no limitation of the number of concurrent connections  over the admin interface
  • restrict access to the admin interface to privileged users

The Facebook contribution also implemented a dedicated thread for listening to admin connections, and this option is implemented  and discussed in the next chapter.

Configuration

To access the admin interface the new SERVICE_CONNECTION_ADMIN privilege must be granted to the admin users. If a user without this privilege tries to connect to the admin interface, connection will be refused, and an error returned.

To configure the admin interface, the following options are available

  • –admin-address The IP address of the admin interface. There is no default value. If this option is not specified at startup, the server maintains no administrative interface.
  • –admin-port The port number of the admin interface (optional, defaults to 33062).
bIjeiaJ.png!web In this figure the MySQL admin interface is separated on a physical NIC, but that is not a requirement. At ip1, ip2 and ip3 the clients connect to the default portno 3306, and at ip7 the client connects to the default admin port 33062.

By default the admin interface is handled by the ordinary MySQL listener thread, which always checks incoming connections on the admin interface before handling requests on the standard MySQL interface. There is a small cost to this in the general case, but still this is the default and recommended configuration.

If the user chooses to have a dedicated thread for the admin interface, this can be specified with the following option

If you specify this option, the MySQL server leaves it to the OS thread scheduler for priority of handling incoming connection requests. The Facebook contribution implemented this dedicated thread as it had shown better performance on specific hardware/OS combinations.

Note that:

Thanks for using MySQL!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK