![]() ![]() It is enough to execute these queries on one MySQL master as changes will replicate to others. Replace haproxy_root and password with your own secure values. ![]() mysql -u root -p -e "GRANT ALL PRIVILEGES ON *.* TO IDENTIFIED BY 'password' WITH GRANT OPTION FLUSH PRIVILEGES" While this can be fixed by granting additional privileges to the root user, it is better to have a separate user with root privileges. The default root user on all the servers are allowed to login only locally. mysql -u root -p -e "INSERT INTO er (Host,User) values ('10.0.0.100','haproxy_check') FLUSH PRIVILEGES "Ī MySQL user is needed with root privileges when accessing the MySQL cluster from HAProxy. The first user will be used by HAProxy to check the status of a server. We need to prepare the MySQL servers by creating two additional users for HAProxy. The following three droplets will be used in this article:īefore proceeding, make sure all MySQL servers are up, running and are properly replicating database writes. ![]() All your MySQL servers have to be configured to perform Master-Master replication as load balancing involves both reading and writing to all the backends. In the previous article on HAProxy we configured load balancing for HTTP and in this one we’ll do the same for MySQL. HAProxy is an open source software which can load balance HTTP and TCP servers. ![]()
0 Comments
Leave a Reply. |