主頁 > 資料庫 > mycat實作mysql基于GITD實作雙主雙從讀寫分離master節點高可用

mycat實作mysql基于GITD實作雙主雙從讀寫分離master節點高可用

2023-05-24 08:53:50 資料庫

架構說明

10.0.0.18 master節點和10.0.0.22節點互為主
10.0.0.19 10.0.0.18的slave節點
10.0.0.22 master節點和10.0.0.19節點互為主
10.0.0.24 10.0.0.22的slave節點
10.0.0.23 mycat節點
mysql版本8.0.32
系統版本:rocky8.4

mysql主從搭建

#搭建雙主節點
#搭建第一個主10.0.0.18
#注釋掉/etc/my.cnf.d/mysql-server.cnf
cat >/etc/my.cnf.d/mysql-server.cnf<<'EOF'
#
# This group are read by MySQL server.
# Use it for options that only the server (but not clients) should see
#
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/en/server-configuration-defaults.html

# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd

#[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
#log-error=/var/log/mysql/mysqld.log
#pid-file=/run/mysqld/mysqld.pid
#log-bin=/data/mysql/logbin/mysql-bin
EOF

#配置主節點的my.cat配置
cat >/etc/my.cnf<<'EOF'
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysql/mysqld.log
pid-file=/run/mysqld/mysqld.pid
server-id=18
#read-only
general_log
gtid_mode=ON
enforce_gtid_consistency
log-bin=/data/mysql/logbin/mysql-bin
EOF

#創建存放二進制日志的目錄
mkdir -p /data/mysql/logbin/
chown -R mysql.mysql /data

#啟動資料庫
systemctl enable --now mysqld

#配置賬號和授權
mysql
create user 'repluser'@'10.0.0.%' identified by '123456';
grant replication slave on *.* to 'repluser'@'10.0.0.%';
#創建mycat使用的賬號
create user 'wbiao'@'10.0.0.%' IDENTIFIED BY '123456';
grant ALL ON hellodb.* TO 'wbiao'@'10.0.0.%';

#搭建第二個主10.0.0.22
#注釋掉/etc/my.cnf.d/mysql-server.cnf
cat >/etc/my.cnf.d/mysql-server.cnf<<'EOF'
#
# This group are read by MySQL server.
# Use it for options that only the server (but not clients) should see
#
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/en/server-configuration-defaults.html

# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd

#[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
#log-error=/var/log/mysql/mysqld.log
#pid-file=/run/mysqld/mysqld.pid
#log-bin=/data/mysql/logbin/mysql-bin
EOF

#配置主節點的my.cat配置
cat >/etc/my.cnf<<'EOF'
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysql/mysqld.log
pid-file=/run/mysqld/mysqld.pid
server-id=22
#read-only
general_log
gtid_mode=ON
enforce_gtid_consistency
log-bin=/data/mysql/logbin/mysql-bin
EOF

#創建存放二進制日志的目錄
mkdir -p /data/mysql/logbin/
chown -R mysql.mysql /data

#啟動資料庫
systemctl enable --now mysqld

#10.0.0.22指向10.0.0.18
執行change master to
CHANGE MASTER TO
MASTER_HOST='10.0.0.18',
MASTER_USER='repluser',
MASTER_PASSWORD='123456',
MASTER_PORT=3306,
MASTER_AUTO_POSITION=1;
#開啟IO執行緒和SQL執行緒
start slave;
#檢查狀態
show slave status\G
#檢查
mysql> select user,host from mysql.user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| repluser         | 10.0.0.%  |
| wbiao            | 10.0.0.%  |
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
6 rows in set (0.00 sec)


10.0.0.18指向10.0.0.22
執行change master to
CHANGE MASTER TO
MASTER_HOST='10.0.0.22',
MASTER_USER='repluser',
MASTER_PASSWORD='123456',
MASTER_PORT=3306,
MASTER_AUTO_POSITION=1;
#開啟IO執行緒和SQL執行緒
start slave;
#檢查狀態
show slave status\G

#配置10.0.0.18的從節點10.0.0.19
#注釋掉/etc/my.cnf.d/mysql-server.cnf
cat >/etc/my.cnf.d/mysql-server.cnf<<'EOF'
#
# This group are read by MySQL server.
# Use it for options that only the server (but not clients) should see
#
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/en/server-configuration-defaults.html

# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd

#[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
#log-error=/var/log/mysql/mysqld.log
#pid-file=/run/mysqld/mysqld.pid
#log-bin=/data/mysql/logbin/mysql-bin
EOF
#配置從節點10.0.0.19的my.cat配置
cat >/etc/my.cnf<<'EOF'
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysql/mysqld.log
pid-file=/run/mysqld/mysqld.pid
server-id=19
read-only
general_log
gtid_mode=ON
enforce_gtid_consistency
log-bin=/data/mysql/logbin/mysql-bin
EOF

#創建存放二進制日志的目錄
mkdir -p /data/mysql/logbin/
chown -R mysql.mysql /data
#啟動資料庫
systemctl enable --now mysqld

#從節點10.0.0.19執行change master to
CHANGE MASTER TO
MASTER_HOST='10.0.0.18',
MASTER_USER='repluser',
MASTER_PASSWORD='123456',
MASTER_PORT=3306,
MASTER_AUTO_POSITION=1;
#開啟IO執行緒和SQL執行緒
start slave;
#檢查狀態
show slave status\G


##配置10.0.0.22的從節點10.0.0.24
#注釋掉/etc/my.cnf.d/mysql-server.cnf
cat >/etc/my.cnf.d/mysql-server.cnf<<'EOF'
#
# This group are read by MySQL server.
# Use it for options that only the server (but not clients) should see
#
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/en/server-configuration-defaults.html

# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd

#[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
#log-error=/var/log/mysql/mysqld.log
#pid-file=/run/mysqld/mysqld.pid
#log-bin=/data/mysql/logbin/mysql-bin
EOF
#配置從節點10.0.0.24的my.cat配置
cat >/etc/my.cnf<<'EOF'
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysql/mysqld.log
pid-file=/run/mysqld/mysqld.pid
server-id=24
read-only
general_log
gtid_mode=ON
enforce_gtid_consistency
log-bin=/data/mysql/logbin/mysql-bin
EOF

#創建存放二進制日志的目錄
mkdir -p /data/mysql/logbin/
chown -R mysql.mysql /data
#啟動資料庫
systemctl enable --now mysqld

#從節點10.0.0.24執行change master to
CHANGE MASTER TO
MASTER_HOST='10.0.0.22',
MASTER_USER='repluser',
MASTER_PASSWORD='123456',
MASTER_PORT=3306,
MASTER_AUTO_POSITION=1;
#開啟IO執行緒和SQL執行緒
start slave;
#檢查狀態
show slave status\G

#10.0.0.18匯入hellodb的資料庫
[root@10 ~]# mysql <hellodb_innodb.sql
##檢查狀態
show slave status\G
#所有節點檢查資料
select * from hellodb.students;
#雙主只能對一個主進行寫操作

 mycat搭建10.0.0.23

#安裝java環境
yum -y install java
#創建安裝目錄和解壓
mkdir -p /apps
tar -xf Mycat-server-1.6.7.6-release-20210303094759-linux.tar.gz -C /app
#配置環境變數
[root@10 ~]# echo 'PATH=/apps/mycat/bin:$PATH' > /etc/profile.d/mycat.sh
[root@10 ~]# . /etc/profile.d/mycat.sh
[root@10 ~]# echo $PATH
/apps/mycat/bin:/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

#配置mycat實作讀寫分離主從高可用
#修改schema.xml的組態檔
#balance="2",所有讀操作都隨機的在writeHost、readhost上分發,
#balance="1",全部的readHost與stand by writeHost參與select陳述句的負載均衡,簡單的說,當雙主雙從模式(M1->S1,M2->S2,并且M1與M2互為主備)
#writeType屬性負載均衡型別,目前的取值有3種:
#1.writeType="0", 所有寫操作發送到配置的第一個writeHost,第一個掛了切到還生存的第二個writeHost,重新啟動后已切換后的為準,切換記錄在組態檔中:dnindex.properties.
#2.writeType="1",所有寫操作都隨機的發送到配置的writeHost,1.5以后廢棄不推薦,
#3.writeType="2",不執行寫操作
[root@10 conf]# cat schema.xml
<?xml version="1.0"?>
<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
<mycat:schema xmlns:mycat="http://io.mycat/">
    <schema name="wbiao" checkSQLschema="false" sqlMaxLimit="100" dataNode="dn1">
    </schema>
    <dataNode name="dn1" dataHost="localhost1" database="hellodb" />
    <dataHost name="localhost1" maxCon="1000" minCon="10" balance="1"
              writeType="0" dbType="mysql" dbDriver="native" switchType="1"  slaveThreshold="100">
        <heartbeat>select user()</heartbeat>
        <writeHost host="host1" url="10.0.0.18:3306" user="wbiao" password="123456">
         <readHost host="host2" url="10.0.0.19:3306" user="wbiao" password="123456" />
        </writeHost>
    <writeHost host="host3" url="10.0.0.22:3306" user="wbiao" password="123456">
         <readHost host="host4" url="10.0.0.23:3306" user="wbiao" password="123456" />
        </writeHost>
    </dataHost>
</mycat:schema>


#server.xml組態檔
[root@10 conf]# cat server.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- - - Licensed under the Apache License, Version 2.0 (the "License"); 
    - you may not use this file except in compliance with the License. - You 
    may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 
    - - Unless required by applicable law or agreed to in writing, software - 
    distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 
    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the 
    License for the specific language governing permissions and - limitations 
    under the License. -->
<!DOCTYPE mycat:server SYSTEM "server.dtd">
<mycat:server xmlns:mycat="http://io.mycat/">
    <system>
    <property name="nonePasswordLogin">0</property> <!-- 0為需要密碼登陸、1為不需要密碼登陸 ,默認為0,設定為1則需要指定默認賬戶-->
    <property name="ignoreUnknownCommand">0</property><!-- 0遇上沒有實作的報文(Unknown command:),就會報錯、1為忽略該報文,回傳ok報文,
    在某些mysql客戶端存在客戶端已經登錄的時候還會繼續發送登錄報文,mycat會報錯,該設定可以繞過這個錯誤-->
    <property name="useHandshakeV10">1</property>
    <property name="removeGraveAccent">1</property>
    <property name="useSqlStat">0</property>  <!-- 1為開啟實時統計、0為關閉 -->
    <property name="useGlobleTableCheck">0</property>  <!-- 1為開啟全加班一致性檢測、0為關閉 -->
    <property name="sqlExecuteTimeout">300</property>  <!-- SQL 執行超時 單位:秒-->
        <property name="sequenceHandlerType">1</property>
    <!--<property name="sequnceHandlerPattern">(?:(\s*next\s+value\s+for\s*MYCATSEQ_(\w+))(,|\)|\s)*)+</property>
    INSERT INTO `travelrecord` (`id`,user_id) VALUES ('next value for MYCATSEQ_GLOBAL',"xxx");
    -->
    <!--必須帶有MYCATSEQ_或者 mycatseq_進入序列匹配流程 注意MYCATSEQ_有空格的情況-->
    <property name="sequnceHandlerPattern">(?:(\s*next\s+value\s+for\s*MYCATSEQ_(\w+))(,|\)|\s)*)+</property>
    <property name="subqueryRelationshipCheck">false</property> <!-- 子查詢中存在關聯查詢的情況下,檢查關聯欄位中是否有分片欄位 .默認 false -->
    <property name="sequenceHanlderClass">io.mycat.route.sequence.handler.HttpIncrSequenceHandler</property>
      <!--  <property name="useCompression">1</property>--> <!--1為開啟mysql壓縮協議-->
        <!--  <property name="fakeMySQLVersion">5.6.20</property>--> <!--設定模擬的MySQL版本號-->
    <!-- <property name="processorBufferChunk">40960</property> -->
    <!-- 
    <property name="processors">1</property> 
    <property name="processorExecutor">32</property> 
     -->
        <!--默認為type 0: DirectByteBufferPool | type 1 ByteBufferArena | type 2 NettyBufferPool -->
        <property name="processorBufferPoolType">0</property>
        <property name="serverPort">3306</property>
        <!--默認是65535 64K 用于sql決議時最大文本長度 -->
        <!--<property name="maxStringLiteralLength">65535</property>-->
        <!--<property name="sequenceHandlerType">0</property>-->
        <!--<property name="backSocketNoDelay">1</property>-->
        <!--<property name="frontSocketNoDelay">1</property>-->
        <!--<property name="processorExecutor">16</property>-->
        <!--
            <property name="serverPort">8066</property>
            <property name="managerPort">9066</property>
            <property name="idleTimeout">300000</property>
            <property name="authTimeout">15000</property>
            <property name="bindIp">0.0.0.0</property>
            <property name="dataNodeIdleCheckPeriod">300000</property> 5 * 60 * 1000L; //連接空閑檢查
            <property name="frontWriteQueueSize">4096</property> <property name="processors">32</property> -->
        <!--分布式事務開關,0為不過濾分布式事務,1為過濾分布式事務(如果分布式事務內只涉及全域表,則不過濾),2為不過濾分布式事務,但是記錄分布式事務日志-->
        <property name="handleDistributedTransactions">0</property>
        
            <!--
            off heap for merge/order/group/limit      1開啟   0關閉
        -->
        <property name="useOffHeapForMerge">0</property>

        <!--
            單位為m
        -->
        <property name="memoryPageSize">64k</property>

        <!--
            單位為k
        -->
        <property name="spillsFileBufferSize">1k</property>

        <property name="useStreamOutput">0</property>

        <!--
            單位為m
        -->
        <property name="systemReserveMemorySize">384m</property>


        <!--是否采用zookeeper協調切換  -->
        <property name="useZKSwitch">false</property>

        <!-- XA Recovery Log日志路徑 -->
        <!--<property name="XARecoveryLogBaseDir">./</property>-->

        <!-- XA Recovery Log日志名稱 -->
        <!--<property name="XARecoveryLogBaseName">tmlog</property>-->
        <!--如果為 true的話 嚴格遵守隔離級別,不會在僅僅只有select陳述句的時候在事務中切換連接-->
        <property name="strictTxIsolation">false</property>
        <!--如果為0的話,涉及多個DataNode的catlet任務不會跨執行緒執行-->
        <property name="parallExecute">0</property>
        <property name="serverBacklog">2048</property>
    </system>
    
    <!-- 全域SQL防火墻設定 -->
    <!--白名單可以使用通配符%或著*-->
    <!--例如<host host="127.0.0.*" user="root"/>-->
    <!--例如<host host="127.0.*" user="root"/>-->
    <!--例如<host host="127.*" user="root"/>-->
    <!--例如<host host="1*7.*" user="root"/>-->
    <!--這些配置情況下對于127.0.0.1都能以root賬戶登錄-->
    <!--
    <firewall>
       <whitehost>
          <host host="1*7.0.0.*" user="root"/>
       </whitehost>
       <blacklist check="false">
       </blacklist>
    </firewall>
    -->

    <user name="root" defaultAccount="true">
        <property name="password">qwe123</property>
        <property name="schemas">wbiao</property>
        <property name="defaultSchema">wbiao</property>
        <!--No MyCAT Database selected 錯誤前會嘗試使用該schema作為schema,不設定則為null,報錯 -->
        
        <!-- 表級 DML 權限設定 -->
        <!--         
        <privileges check="false">
            <schema name="wbiao" dml="0110" >
                <table name="tb01" dml="0000"></table>
                <table name="tb02" dml="1111"></table>
            </schema>
        </privileges>        
         -->
    </user>

    <user name="user">
        <property name="password">user</property>
        <property name="schemas">wbiao</property>
        <property name="readOnly">true</property>
        <property name="defaultSchema">wbiao</property>
    </user>

</mycat:server>


#啟動mycat
[root@10 conf]# mycat start
Starting Mycat-server...
監控日志
[root@10 ~]# tail -F /apps/mycat/logs/wrapper.log
STATUS | wrapper  | 2023/05/24 02:44:41 | <-- Wrapper Stopped
STATUS | wrapper  | 2023/05/24 02:44:45 | --> Wrapper Started as Daemon
STATUS | wrapper  | 2023/05/24 02:44:45 | Launching a JVM...
INFO   | jvm 1    | 2023/05/24 02:44:46 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO   | jvm 1    | 2023/05/24 02:44:46 |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
INFO   | jvm 1    | 2023/05/24 02:44:46 | 
INFO   | jvm 1    | 2023/05/24 02:44:48 | MyCAT Server startup successfully. see logs in logs/mycat.log

#鏈接測驗
[root@10 conf]# mysql -uroot -pqwe123 -h10.0.0.23
#讀測驗
mysql> select @@hostname;
+------------+
| @@hostname |
+------------+
| 10.0.0.24  |
+------------+
1 row in set (0.08 sec)

mysql> select @@hostname;
+------------+
| @@hostname |
+------------+
| 10.0.0.22  |
+------------+
1 row in set (0.00 sec)

mysql> select @@hostname;
+------------+
| @@hostname |
+------------+
| 10.0.0.19  |
+------------+
1 row in set (0.01 sec)

mysql> select @@hostname;
+------------+
| @@hostname |
+------------+
| 10.0.0.19  |
+------------+
1 row in set (0.01 sec)

mysql> select @@hostname;
+------------+
| @@hostname |
+------------+
| 10.0.0.24  |
+------------+
1 row in set (0.01 sec)

mysql> select @@hostname;
+------------+
| @@hostname |
+------------+
| 10.0.0.22  |
+------------+
1 row in set (0.00 sec)
#寫測驗
mysql> update teachers set name=@@hostname where tid=5;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0

mysql> select * from teachers;
+-----+---------------+-----+--------+
| TID | Name          | Age | Gender |
+-----+---------------+-----+--------+
|   1 | Song Jiang    |  45 | M      |
|   2 | Zhang Sanfeng |  94 | M      |
|   3 | Miejue Shitai |  77 | F      |
|   4 | 10.0.0.18     |  93 | F      |
+-----+---------------+-----+--------+
4 rows in set (0.00 sec)
mysql> update teachers set name=@@hostname where tid=3;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from teachers;
+-----+---------------+-----+--------+
| TID | Name          | Age | Gender |
+-----+---------------+-----+--------+
|   1 | Song Jiang    |  45 | M      |
|   2 | Zhang Sanfeng |  94 | M      |
|   3 | 10.0.0.18     |  77 | F      |
|   4 | 10.0.0.18     |  93 | F      |
+-----+---------------+-----+--------+
4 rows in set (0.00 sec)

#關閉10.0.0.18的mysql
[root@10 ~]# systemctl stop mysqld
#mycat做主的高可用的寫測驗
mysql> select * from teachers;
+-----+---------------+-----+--------+
| TID | Name          | Age | Gender |
+-----+---------------+-----+--------+
|   1 | Song Jiang    |  45 | M      |
|   2 | Zhang Sanfeng |  94 | M      |
|   3 | 10.0.0.18     |  77 | F      |
|   4 | 10.0.0.18     |  93 | F      |
+-----+---------------+-----+--------+
4 rows in set (0.00 sec)

mysql> update teachers set name=@@hostname where tid=1;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from teachers;
+-----+---------------+-----+--------+
| TID | Name          | Age | Gender |
+-----+---------------+-----+--------+
|   1 | 10.0.0.22     |  45 | M      |
|   2 | Zhang Sanfeng |  94 | M      |
|   3 | 10.0.0.18     |  77 | F      |
|   4 | 10.0.0.18     |  93 | F      |
+-----+---------------+-----+--------+
4 rows in set (0.01 sec)

mysql> update teachers set name=@@hostname where tid=2;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from teachers;
+-----+-----------+-----+--------+
| TID | Name      | Age | Gender |
+-----+-----------+-----+--------+
|   1 | 10.0.0.22 |  45 | M      |
|   2 | 10.0.0.22 |  94 | M      |
|   3 | 10.0.0.18 |  77 | F      |
|   4 | 10.0.0.18 |  93 | F      |
+-----+-----------+-----+--------+
4 rows in set (0.00 sec)

 

轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/553244.html

標籤:MySQL

上一篇:小白零基礎在 Centos 7 中安裝 mysql

下一篇:返回列表

標籤雲
其他(159584) Python(38165) JavaScript(25446) Java(18111) C(15231) 區塊鏈(8268) C#(7972) AI(7469) 爪哇(7425) MySQL(7208) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5873) 数组(5741) R(5409) Linux(5340) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4575) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2433) ASP.NET(2403) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) .NET技术(1976) 功能(1967) Web開發(1951) HtmlCss(1941) C++(1922) python-3.x(1918) 弹簧靴(1913) xml(1889) PostgreSQL(1878) .NETCore(1861) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • GPU虛擬機創建時間深度優化

    **?桔妹導讀:**GPU虛擬機實體創建速度慢是公有云面臨的普遍問題,由于通常情況下創建虛擬機屬于低頻操作而未引起業界的重視,實際生產中還是存在對GPU實體創建時間有苛刻要求的業務場景。本文將介紹滴滴云在解決該問題時的思路、方法、并展示最終的優化成果。 從公有云服務商那里購買過虛擬主機的資深用戶,一 ......

    uj5u.com 2020-09-10 06:09:13 more
  • 可編程網卡芯片在滴滴云網路的應用實踐

    **?桔妹導讀:**隨著云規模不斷擴大以及業務層面對延遲、帶寬的要求越來越高,采用DPDK 加速網路報文處理的方式在橫向縱向擴展都出現了局限性。可編程芯片成為業界熱點。本文主要講述了可編程網卡芯片在滴滴云網路中的應用實踐,遇到的問題、帶來的收益以及開源社區貢獻。 #1. 資料中心面臨的問題 隨著滴滴 ......

    uj5u.com 2020-09-10 06:10:21 more
  • 滴滴資料通道服務演進之路

    **?桔妹導讀:**滴滴資料通道引擎承載著全公司的資料同步,為下游實時和離線場景提供了必不可少的源資料。隨著任務量的不斷增加,資料通道的整體架構也隨之發生改變。本文介紹了滴滴資料通道的發展歷程,遇到的問題以及今后的規劃。 #1. 背景 資料,對于任何一家互聯網公司來說都是非常重要的資產,公司的大資料 ......

    uj5u.com 2020-09-10 06:11:05 more
  • 滴滴AI Labs斬獲國際機器翻譯大賽中譯英方向世界第三

    **桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......

    uj5u.com 2020-09-10 06:11:29 more
  • MPP (Massively Parallel Processing)大規模并行處理

    1、什么是mpp? MPP (Massively Parallel Processing),即大規模并行處理,在資料庫非共享集群中,每個節點都有獨立的磁盤存盤系統和記憶體系統,業務資料根據資料庫模型和應用特點劃分到各個節點上,每臺資料節點通過專用網路或者商業通用網路互相連接,彼此協同計算,作為整體提供 ......

    uj5u.com 2020-09-10 06:11:41 more
  • 滴滴資料倉庫指標體系建設實踐

    **桔妹導讀:**指標體系是什么?如何使用OSM模型和AARRR模型搭建指標體系?如何統一流程、規范化、工具化管理指標體系?本文會對建設的方法論結合滴滴資料指標體系建設實踐進行解答分析。 #1. 什么是指標體系 ##1.1 指標體系定義 指標體系是將零散單點的具有相互聯系的指標,系統化的組織起來,通 ......

    uj5u.com 2020-09-10 06:12:52 more
  • 單表千萬行資料庫 LIKE 搜索優化手記

    我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......

    uj5u.com 2020-09-10 06:13:25 more
  • 滴滴Ceph分布式存盤系統優化之鎖優化

    **桔妹導讀:**Ceph是國際知名的開源分布式存盤系統,在工業界和學術界都有著重要的影響。Ceph的架構和演算法設計發表在國際系統領域頂級會議OSDI、SOSP、SC等上。Ceph社區得到Red Hat、SUSE、Intel等大公司的大力支持。Ceph是國際云計算領域應用最廣泛的開源分布式存盤系統, ......

    uj5u.com 2020-09-10 06:14:51 more
  • es~通過ElasticsearchTemplate進行聚合~嵌套聚合

    之前寫過《es~通過ElasticsearchTemplate進行聚合操作》的文章,這一次主要寫一個嵌套的聚合,例如先對sex集合,再對desc聚合,最后再對age求和,共三層嵌套。 Aggregations的部分特性類似于SQL語言中的group by,avg,sum等函式,Aggregation ......

    uj5u.com 2020-09-10 06:14:59 more
  • 爬蟲日志監控 -- Elastc Stack(ELK)部署

    傻瓜式部署,只需替換IP與用戶 導讀: 現ELK四大組件分別為:Elasticsearch(核心)、logstash(處理)、filebeat(采集)、kibana(可視化) 下載均在https://www.elastic.co/cn/downloads/下tar包,各組件版本最好一致,配合fdm會 ......

    uj5u.com 2020-09-10 06:15:05 more
最新发布
  • mycat實作mysql基于GITD實作雙主雙從讀寫分離master節點高可用

    架構說明 10.0.0.18 master節點和10.0.0.22節點互為主 10.0.0.19 10.0.0.18的slave節點 10.0.0.22 master節點和10.0.0.19節點互為主 10.0.0.24 10.0.0.22的slave節點 10.0.0.23 mycat節點 mys ......

    uj5u.com 2023-05-24 08:53:50 more
  • 小白零基礎在 Centos 7 中安裝 mysql

    本文參考這三篇博文,安裝,修改配置,修改密碼。感謝大佬的分享 首先安裝好Centos,并使用xshell連接 一、下載 1、下載安裝檔案 建議自己到這個地址下載 https://dev.mysql.com/downloads/mysql/。選擇以下版本 2、下載完后上傳到系統,并解壓,可以用 tar ......

    uj5u.com 2023-05-23 10:12:20 more
  • 線上問題處理案例:出乎意料的資料庫連接池

    本文是線上問題處理案例系列之一,旨在通過真實案例向讀者介紹發現問題、定位問題、解決問題的方法。本文講述了從垃圾回收耗時過長的表象,逐步定位到資料庫連接池保活問題的全程序,并對其中用到的一些知識點進行了總結。 ......

    uj5u.com 2023-05-23 09:55:48 more
  • 看完這篇,DWS故障修復不再愁

    摘要:本文詳細梳理分析了DWS服務面臨軟硬體故障場景和對應的修復原理,希望借此能夠讓你對DWS的集群故障修復有個全面深入的了解。 本文分享自華為云社區《GaussDB(DWS)故障修復系統性介紹》,作者: 聞鮮生。 DWS是一個分布式架構的MPP集群,物理部署上涉及數百數千臺主機和對應的磁盤,以及這 ......

    uj5u.com 2023-05-23 09:55:40 more
  • Redis安裝,主從復制、哨兵模式、集群

    淺淺的記錄下Redis安裝、主從、哨兵、集群。搭建筆記 一.Redis下載安裝 系統環境 redis版本:7.0.11 linux版本:CentOS Linux release 8.2.2004 (Core) 官網下載地址:https://redis.io/download/ 一些安裝命令,按照步驟 ......

    uj5u.com 2023-05-23 09:50:19 more
  • 為什么MySQL單表不能超過2000萬行?

    摘要:MySQL一張表最多能存多少資料? 本文分享自華為云社區《為什么MySQL單表不能超過2000萬行?》,作者: GaussDB 資料庫 。 最近看到一篇《我說MySQL每張表最好不要超過2000萬資料,面試官讓我回去等通知》的文章,非常有趣。 文中提到,他朋友在面試的程序中說,自己的作業就是把 ......

    uj5u.com 2023-05-23 09:43:51 more
  • Redis - 二進制位陣列

    數學上有一個“計算漢明重量”的問題,即求取一個二進制位中非 0 的數量。使用 Redis 提供的 Bitmap 統計時恰恰是這樣一個問題,學習后能發現解決辦法卻是如此巧妙。 ......

    uj5u.com 2023-05-23 09:43:39 more
  • Redis單機部署

    # Redis單機部署 ## 1 安裝 下載最新穩定版Redis https://download.redis.io/redis-stable.tar.gz ```shell # 安裝wget yum install -y wget # 安裝gcc環境 yum install gcc-c++ # 獲 ......

    uj5u.com 2023-05-23 09:43:31 more
  • MySQL 并行復制方案演進歷史及原理分析

    有過線上 MySQL 維護經驗的童鞋都知道,主從延遲往往是一個讓人頭疼不已的問題。



    不僅僅是其造成的潛在問題比較嚴重,而且主從延遲原因的定位尤其考量 DBA 的綜合能力:既要熟悉復制的內部原理,又能解讀主機層面的資源使用情況,甚至還要會分析 binlog。



    導致主從延遲的一個常見原因是,... ......

    uj5u.com 2023-05-23 09:43:20 more
  • 看完這篇,DWS故障修復不再愁

    摘要:本文詳細梳理分析了DWS服務面臨軟硬體故障場景和對應的修復原理,希望借此能夠讓你對DWS的集群故障修復有個全面深入的了解。 本文分享自華為云社區《GaussDB(DWS)故障修復系統性介紹》,作者: 聞鮮生。 DWS是一個分布式架構的MPP集群,物理部署上涉及數百數千臺主機和對應的磁盤,以及這 ......

    uj5u.com 2023-05-23 09:42:48 more