3 thoughts on “Is DBLE the expansion of the database?”

  1. DBLE is a distributed database.
    DBLE official website: .ACTIONSKY
    DBLE official project: github // dble
    dble download address: github // dble/releases
    n

  2. DBLE project information

    Dble is an enterprise -level open source distributed middleware, the rivers and lakes send the nickname “MyCat Plus”; The good community environment and the majority of the masses have received strong support from the community;

    DBLE official website:
    .Actionsky
    The details that this article does not involve can be obtained in more details in the official document; for the classmates, you can use this article as the fast entry foundation
    dble official project:
    github // dble
    If you are interested in the source code or you need to customize the function, you can compile and install the source code
    dble download address:
    github // dble/releases
    DBLE official community exchange group: 669663113
    n n n n n n n n n R N Install the JDK environment

    Dble is developed using Java, so you need to install the Java version 1.8 or above on the machine to start the DBLE, and make sure that java_home The parameters are set correctly;
    The operating OpenJDK through YUM sources, students can go to the hundreds of installation methods of Google JDK by themselves, and I won’t go into details here;
    bash# yum install java-1.8.0- Openjdk

    The confirmation of the configuration of the java environment;
    bash# java-veersion “1.8.0_191” OpenJDK Runtime (Build 1.8.0_191-B12) OpenJDK 64-bit Server VM (Build 25.191-B12 , Mixed Mode)

    Conneed DBLE

    dble installation is actually just unzip the download directory, which is very simple.
    In this connection to download the latest installation package: github // dble/releases
    to decompress and install dble to the specified folder
    mkdir -P $ Working_DIR CD $ Working_DIR TAR -DBLE- $ Version .tar.gz CD $ Working_DIR/DBLE/CONF
    After the installation is completed, the directory is as follows:

    Please click to enter the picture description

    Dble’s configuration files are all in the CONF directory. Here are a few commonly used files:
    Application scenario 1: Data split
    ▽ back end mysql node
    dble’s architecture is actually very good Understand, DBLE is an agent middleware, and the physical database behind DBLE is the physical database. For users, all visits are DBLE, which will not be exposed to the back -end database.
    I first demonstrate the function of simple data splitting. The physical deployment structure is as follows:
    Please click Enter the picture description
    Remarks: In order to demonstrate simple, the instances are deployed on one machine and distinguished with different ports. Students can also use three machines with three machines Come on the environment.
    Coloning the library table testdb.users in MySQL A and MySQL B to facilitate subsequent verification. The table structure is as follows:
    create table `users` (
    `id` int
    `User` varchar (20) default null,
    primary key (`ID`)
    ) Engine = Innodb default charset = latin1
    ▽ml nserver.xml You can configure many parameters related to DBLE itself. Here the focus is only concerned about the configuration related to the interview user below, other default;
    “u003Csystem>” is the service port of DBLE (default 8066) The configuration of the management port (default 9066)
    The management port can only accept the management command of DBLE. Do not do it here
    Duan “u003Cuser>” configures the management of the management theoretical manager, the default is MAN1, and the password is 654321
    that can be issued by mysql -P9066 -H 127.0.0.1 -u man1 -P654321 “u003CUser>” configure business users, configure a account password Password, for database testdb, read and write permissions, and do not make any special permissions for tables. Therefore MySQL -P8066 -H 127.0.0.1 -UTEST -PPASSWORD Send SQL statement

    u003Csystem>

    u003C! > 8066 u003C/Property>->
    u003C!-u003CProperty name = “”> 9066 u003C/Property>->

    u003C/system> r
    u003Cuser name = “man1″>
    u003Cproperty name = “password”> 654321 u003C/Property>
    u003Cpropoperty name = “manager”> true u003C/property>
    u003C!- – manager user cant set schema–>rnu003C/user>rnu003Cuser name=”test”>rnu003Cproperty na Me = “Password”> Password u003C/Property>
    u003CProperty name = “Schemas”> Testdb u003C/Property>
    u003C!-Tables DML Insert/Update/Select/Delete->
    u003C!-
    u003Ccheck = “false”>
    u003Cschema name = “testdb” dml = “0110”>
    u003Ctable name = “tb01” dml = “0000” > u003C/table>
    u003Ctable name = “tb02” dml = “1111”> u003C/table>
    u003C/schema>
    u003C/>
    ->
    u003C/user>

    Please click in the input image description
    ▽ schema.xml
    schema.xml is the main configuration item, we take the USERS user table according to the use The way the mold is split on average to the two data databases of MySQL A and MySQL B. For details, please see the configuration file:

    DBLE: Schema System “schema.dtd”>
    u003Cdble: schema xmlns: dble = “dble.cloud/”>
    u003Cschema name = “testdb”>
    u003Ctable name = ” Users “=” ID “datanode =” dn1, dn2 “rule =” Sharding-BY-MOD2 ” />
    u003C /schema>
    u003C!-Size configuration->
    u003Cdatanode name = “dn1” datahost = “group1” database = “testdb”/>
    u003Cdatanode name = “dn2” datahost = “group2” database = “testdb”/>
    u003C!— Physical database configuration->
    u003Cdatahost name = “group1” maxcon = “1000” mincon = “10” balance = “0” = “1” = “100”>
    u003Cweartbeat> show slave Status u003C/heartbeat>
    u003CwareHost host = “mysqla” url = “172.16.3. 1: 14014 “user =” test “password =” password “/>
    u003C/datahost>
    u003Cdatahost name =” group2 “maxcon =” 1000 “mincon =” 10 “basar =” 0 ” = “1” = “100”>
    u003CheartBeat> Show Slave Status u003C/heartbeat>
    u003CwareHost Host = “MySQLA” URL = “172.16.3.1:14015” user = “test” password = “Password”/>
    u003C/datahost>
    u003C/dble: schema>
    Parameter description
    · schema logic database information, this database is logical database, name and server.xml Corresponding to SCHEMA corresponding;
    · Datanode fragment information, this is the definition of sharding nodes; the name of the shard and the Datanode of the SCHEMA; For group information, under the Datahost, you can mount the reading and writing physical instance node of the same group to achieve high availability or read and write separation;
    The key attributes of each node explain one by one:
    Schema:
    Properties Instructions:
    · name logic database name, corresponding to the schema in Server.xml;
    · table:
    sub-attribute description:
    -name table name r in the physical database r
    -what nodes are stored in the tables of the table, and multiple nodes are separated by comma
    -primary key to cache and self-increase recognition. Picnic rules, specific rules below Rule detailed introduction
    datanode
    Properties description:
    · name node name, and the Datanode corresponding to the datanode in Table Corresponding
    · database Database name in the physical database;
    datahost
    Properties:
    · name physical database name, as to the method of DataHost in the Datanode R n · The high available switching method of writing nodes; when it is equal to 1, the heartbeat is unhealthy to switch
    · HeartBeat cardiac test statement, pay attention to the end of the sentence Add
    · writehost writing physics instance
    sub-attribute description:
    -host physical instance name
    -URL physical library ip port n-user physical library User
    -password physical library password
    ▽ rule.xml
    mainly pays attention to the Rule attribute. It can basically meet the requirements you need.
    table’s Rule attribute corresponds to the name of tablerule in the rule.xml file. What are the specific split algorithms to implement? It is recommended to see the document. The Sharding-By-MOD2 I chose here is a special case of the Hash algorithm, which is to split the data average. Because my back end is two physical libraries, the hashmod2 in Rule.xml is corresponding to 2, and the configuration is as follows:
    > u003CAlgorithm> Hashmod2 u003C/algorithm> u003C/rule> u003C/tabler> u003Cfunction name = “hashmod2” class = “hash”> u003Cproperty name = “”> 2 u003C/Property> u003CProperty name = “”> 1 u003C/Property> u003C/Function>

    . Click here to click here

  3. Status
    Mysql-PROXY

    Mysql-proxy is the official MySQL middleware service provided by MySQL. The upstream can access several MySQL-Client, and the back end can connect several MySQL-Server.

    This using the MySQL protocol. Any upstream of the upstream of mysql-client does not need to modify any code to migrate to MySQL-PROXY.

    Mysql-PROXY’s most basic usage is to intercept as a request. The intermediate layer of the request transit:

    Mysql-proxy can analyze and modify the request. The interception query and modification results need to be completed by writing the LUA script.

    Mysql-PROXY allows users to specify the LUA script to intercept the request and analyze and modify the request. It also allows users to specify the LUA script to modify the return result of the server

    . Add some results or remove some results.

    . So, fundamentally, MySQL-PROXY is a official framework, which has good scalability and can be used to complete: SQL interception and modification, performance analysis and monitoring, reading and writing separation, request requests, requests, requests routing.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Scroll to Top