mgr dynamic primary selection client-hanboJdbc

hanbo-jdbc is a springbootStarter for mysql5.7+ group replication (single master mode)

Client automatic master selection and load balancing based on connector/J's mysqlx, replication and other protocols. Please move the source code

Pack

cd proDir && mvn clean install

Add maven dependencies:

    <dependency>
        <groupId>com.lmx</groupId>
        <artifactId>hanbo-starter</artifactId>
        <version>0.0.2-snapshot</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.11</version>
    </dependency>

springboot configuration:

application.properties

cj.replicationUrl=jdbc:mysql:replication://address=(type=master)(host=192.168.32.128)(port=24802),address=(type=slave)(host=192.168.32.128)(port=24801),address=(type=slave)(host=192.168.32.128)(port=24803)/test?useSSL=false&autoReconnect=true
cj.userName=root
cj.passWord=root
cj.driverClass=com.mysql.cj.jdbc.Driver
cj.maxWait=10000
cj.maxConn=64
cj.failoverUrl=jdbc:mysql://192.168.32.128:24801,192.168.32.128:24802,192.168.32.128:24803/test?characterEncoding=UTF-8&useSSL=false
{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324075860&siteId=291194637