MySQL 是最流行的關(guān)系型數(shù)據(jù)庫(kù)管理系統(tǒng)
MySQL 配置主備模式
基于一臺(tái)服務(wù)器的數(shù)據(jù)復(fù)制,故得名單機(jī)熱備,主-備 Active-Standby 主-備方式,即指的是一臺(tái)服務(wù)器處于某種業(yè)務(wù)的激活狀態(tài)(即Active狀態(tài)),另一臺(tái)服務(wù)器處于該業(yè)務(wù)的備用狀態(tài)(即Standby狀態(tài)),主數(shù)據(jù)庫(kù)數(shù)據(jù)更新后,備份服務(wù)器同步數(shù)據(jù)只本機(jī)
兩臺(tái)同步執(zhí)行: 安裝Mariadb,設(shè)置初始密碼,啟動(dòng)服務(wù),并設(shè)置開機(jī)自啟動(dòng),這里的配置步驟應(yīng)在兩臺(tái)主機(jī)上同步執(zhí)行
yum install -y mariadb mariadb-server
systemctl restart mariadb
mysql_secure_installation
復(fù)制代碼
修改MariaDB主配置文件,寫入log-bin參數(shù)開啟二進(jìn)制日志文件,然后寫入server-id指定本臺(tái)MariaDB服務(wù)器的ID號(hào)(注意:這里主從不要重復(fù))
vim /etc/my.cnf
[mysqld]
log-bin=mysql-bin #開啟二進(jìn)制日志文件
server-id=12 #本臺(tái)MySQL服務(wù)器ID(主從不能重復(fù))
systemctl restart mariadb #重啟生效
復(fù)制代碼
主數(shù)據(jù)庫(kù)執(zhí)行: 進(jìn)入主MariaDB數(shù)據(jù)庫(kù),授權(quán)給從數(shù)據(jù)庫(kù)登陸的賬號(hào),這里顯示二進(jìn)制日志文件大小并記錄下來(lái)
grant replication slave on *.* to "用戶名"@'%' identified by "密碼"; #創(chuàng)建用于從服務(wù)器登陸的賬號(hào)
show master status; #顯示日志狀態(tài)
MariaDB [(none)]> show master status;
+------------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000002 | 245 | | |
+------------------+----------+--------------+------------------+
row in set (0.00 sec)
復(fù)制代碼
從數(shù)據(jù)庫(kù)執(zhí)行: 進(jìn)入從MariaDB數(shù)據(jù)庫(kù),使用主數(shù)據(jù)庫(kù)授權(quán)的用戶名,密碼,以及相應(yīng)的日志文件名稱 master_log_file,和日志文件位置 master_log_pos,此處在主數(shù)據(jù)庫(kù)上獲取即可
change master to master_host='服務(wù)器IP',master_user='授權(quán)賬號(hào)',master_password='密碼',master_log_file='日志文件',master_log_pos=文件位置;
start slave; #啟用同步
show slave statusG; #查看同步狀態(tài)
注意:兩個(gè)狀態(tài)同時(shí)開啟即可
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
復(fù)制代碼
MySQL 配置主主模式
基于兩臺(tái)服務(wù)器的復(fù)制方式較多,故得名雙機(jī)熱備,雙主機(jī)方式即指兩種不同業(yè)務(wù)分別在兩臺(tái)服務(wù)器上互為主備狀態(tài)(即 Active-Standby和Standby-Active狀態(tài)),這里需要注意的是主-主同步配置,其實(shí)就是兩臺(tái)MariaDB數(shù)據(jù)庫(kù)互為主從,所以,要在兩臺(tái)主機(jī)間作兩次相同的操作
兩臺(tái)同步執(zhí)行: 安裝MariaDB,設(shè)置初始密碼,啟動(dòng)服務(wù),并設(shè)置開機(jī)自啟動(dòng),這里的配置步驟應(yīng)在兩臺(tái)主機(jī)上同步執(zhí)行
yum install -y mariadb mariadb-server
systemctl restart mariadb
mysql_secure_installation
復(fù)制代碼
將MariaDB1的數(shù)據(jù)拷貝到MariaDB2上,實(shí)現(xiàn)數(shù)據(jù)的一致性,(注意:這里應(yīng)先鎖定表結(jié)構(gòu),防止數(shù)據(jù)不一致)
flush tables with read lock; #鎖定數(shù)據(jù)表為只讀模式
mysqldump -u root -p --all-databases >back.sql #備份數(shù)據(jù)庫(kù)
scp back.sql root@192.168.1.13:/root #將數(shù)據(jù)傳遞到遠(yuǎn)程主機(jī)
unlock tables; #解除表鎖定
mysql -uroot -p <back.sql #從數(shù)據(jù)庫(kù)恢復(fù)數(shù)據(jù)
復(fù)制代碼
修改MariaDB主配置文件(注意:兩臺(tái)都要修改),開啟二進(jìn)制日志和制定服務(wù)器ID號(hào)
vim /etc/my.cnf
[mysqld]
log-bin=mysql-bin #開啟二進(jìn)制日志
server-id=10 #指定服務(wù)器ID號(hào)(兩臺(tái)不允許重復(fù))
replicate-do-db=test #要同步的數(shù)據(jù)庫(kù)
binlog-ignore-db=mysql #不需要同步的數(shù)據(jù)庫(kù)
binlog-ignore-db=information_schema #不需要同步的數(shù)據(jù)庫(kù)
auto-increment-increment=2 #每次自增長(zhǎng)2
auto-increment-offset=1 #自增長(zhǎng)從1開始
systemctl restart mariadb
復(fù)制代碼
MySQL1執(zhí)行: 進(jìn)入 MariaDB1 數(shù)據(jù)庫(kù),創(chuàng)建用于從數(shù)據(jù)庫(kù)登陸的賬號(hào)和密碼
grant replication slave on *.* to '用戶名'@'%' identified by '密碼'; #創(chuàng)建用于從數(shù)據(jù)庫(kù)登陸的用戶
show master status; #查看二進(jìn)制文件名
復(fù)制代碼
進(jìn)入 MariaDB2 數(shù)據(jù)庫(kù),同步數(shù)據(jù)
change master to master_host='主服務(wù)器IP',master_user='授權(quán)賬號(hào)',master_password='密碼',master_log_file='二進(jìn)制文名',master_log_pos=文件空間大小;
start slave; #啟動(dòng)同步功能
show slave statusG; #查看同步狀態(tài)
復(fù)制代碼
MySQL2執(zhí)行: 進(jìn)入 MariaDB2 數(shù)據(jù)庫(kù),創(chuàng)建用于從數(shù)據(jù)庫(kù)登陸的賬號(hào)和密碼
grant replication slave on *.* to '用戶名'@'%' identified by '密碼'; #創(chuàng)建用于從數(shù)據(jù)庫(kù)登陸的用戶
show master status; #查看二進(jìn)制文件名
復(fù)制代碼
進(jìn)入 MariaDB1 數(shù)據(jù)庫(kù),同步數(shù)據(jù)
change master to master_host='主服務(wù)器IP',master_user='授權(quán)賬號(hào)',master_password='密碼',master_log_file='二進(jìn)制文名',master_log_pos=文件空間大小;
start slave; #啟動(dòng)同步功能
show slave statusG; #查看同步狀態(tài)
復(fù)制代碼
MySQL 配置主主從模式
主-主-從,字面意思就是,兩個(gè)主一個(gè)從,主要用于數(shù)據(jù)備份,一次性備份兩個(gè)主數(shù)據(jù)庫(kù)資源,這樣一個(gè)從數(shù)據(jù)庫(kù),就可以同時(shí)備份多個(gè)主數(shù)據(jù)庫(kù)了,節(jié)約了寶貴的服務(wù)器資源
兩臺(tái)主數(shù)據(jù)庫(kù)執(zhí)行: 兩臺(tái)主服務(wù)器都需要安裝MySQL初始化并設(shè)置密碼
yum install -y mariadb mariadb-server
systemctl restart mariadb
mysql_secure_installation
復(fù)制代碼
兩臺(tái)主服務(wù)器都應(yīng)配置以下內(nèi)容(兩臺(tái)主MySQL都需要配置)
vim /etc/my.cnf #修改配置文件
寫入以下內(nèi)容↓
log-bin=mysql-bin #開啟二進(jìn)制日志
server-id=147 #服務(wù)器ID號(hào)
systemctl restart mariadb #重啟服務(wù)
復(fù)制代碼
登陸主MySQL并創(chuàng)建用戶從服務(wù)器登陸的用戶 (兩臺(tái)主MySQL都需要配置)
mysql -uroot –p #登陸MySQL
grant replication slave on *.* to '授權(quán)用戶'@'%' identified by '密碼'; #創(chuàng)建從服務(wù)器用戶
show master status; #顯示日志狀態(tài)
復(fù)制代碼
從數(shù)據(jù)庫(kù)執(zhí)行: 切記從MariaDB數(shù)據(jù)庫(kù)不能啟動(dòng),修改從MySQL主配置文件
vim /etc/my.cnf
寫入以下內(nèi)容↓
[mysqld_multi]
mysqld=/usr/bin/mysqld_safe
mysqladmin=/usr/bin/mysqladmin
log=/tmp/multi.log
[mysqld147] #名稱后面加數(shù)字,后期啟動(dòng)用(不應(yīng)相同)
port=3306 #端口號(hào)(不應(yīng)相同)
pid-file=/var/lib/mysqla/mysqld.pid #MySQL進(jìn)程號(hào)保存位置
datadir=/var/lib/mysqla #數(shù)據(jù)文件保存位置
socket=/var/lib/mysqla/mysql.sock #指定登陸套接字
server-id=110 #ID號(hào),同一主從環(huán)境不能相同
user=mysql #MySQL登陸用戶名
[mysqld148] #名稱后面加數(shù)字,后期啟動(dòng)用(不應(yīng)相同)
port=3307 #端口號(hào)(不應(yīng)相同)
pid-file=/var/lib/mysqlb/mysqld.pid #MySQL進(jìn)程號(hào)保存位置
datadir=/var/lib/mysqlb #數(shù)據(jù)文件保存位置
socket=/var/lib/mysqlb/mysql.sock #指定登陸套接字
server-id=110 #ID號(hào),同一主從環(huán)境不能相同
user=mysql #MySQL登陸用戶名
復(fù)制代碼
初始化數(shù)據(jù)庫(kù)
mysql_install_db --datadir=/var/lib/mysqla --user=mysql #初始化數(shù)據(jù)庫(kù)a
mysql_install_db --datadir=/var/lib/mysqlb --user=mysql #初始化數(shù)據(jù)庫(kù)b
復(fù)制代碼
給相應(yīng)目錄賦予權(quán)限
cd /var/lib/
chown -R mysql:mysql /var/lib/mysqla/ #修改a文件權(quán)限
chown -R mysql:mysql /var/lib/mysqlb/ #修改b文件權(quán)限
復(fù)制代碼
啟動(dòng)相應(yīng)服務(wù)器
mysqld_multi --defaults-file=/etc/my.cnf start 147 #開啟147服務(wù)器
mysqld_multi --defaults-file=/etc/my.cnf start 148 #開啟148服務(wù)器
復(fù)制代碼
登陸147和148數(shù)據(jù)庫(kù)確定主從關(guān)系
mysql -P 3306 -S /var/lib/mysqla/mysql.sock #登陸147數(shù)據(jù)庫(kù)
mysql -P 3306 -S /var/lib/mysqlb/mysql.sock #登陸148數(shù)據(jù)庫(kù)
change master to master_host='服務(wù)器IP',master_user='授權(quán)賬號(hào)',master_password='密碼',master_log_file='日志文件',master_log_pos=文件位置;
start slave; #啟用同步
show slave statusG; #查看同步狀態(tài)
復(fù)制代碼
MySQL 實(shí)現(xiàn)讀寫分離
MyCat是一個(gè)開源的,面向企業(yè)應(yīng)用開發(fā)的大數(shù)據(jù)庫(kù)集群,支持事務(wù)、ACID、可以替代MySQL的加強(qiáng)版數(shù)據(jù)庫(kù), 其功能有可以視為MySQL集群的企業(yè)級(jí)數(shù)據(jù)庫(kù),用來(lái)替代昂貴的Oracle集群.融合了內(nèi)存緩存技術(shù)、NoSQL技術(shù)、HDFS大數(shù)據(jù)的新型SQLServer,結(jié)合傳統(tǒng)數(shù)據(jù)庫(kù)和新型分布式數(shù)據(jù)倉(cāng)庫(kù)的新一代企業(yè)級(jí)數(shù)據(jù)庫(kù)產(chǎn)品.
192.168.1.5 MyCat Server
192.168.1.11 Master 主MariaDB
192.168.1.12 Slave1 從1
192.168.1.13 Slave2 從2
復(fù)制代碼
1.在配置讀寫分離前請(qǐng)確保你的主機(jī)有四臺(tái),分別在每臺(tái)主機(jī)安裝MariaDB數(shù)據(jù)庫(kù),并初始化,需要注意的是MyCat服務(wù)端的MariaDB不需要初始化.
[root@localhost ~]# yum install -y mariadb mariadb-server
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable mariadb
復(fù)制代碼
2.在MyCat服務(wù)端安裝JDK環(huán)境,由于MyCat是使用JAVA開發(fā)的,在這里我們要先配置一下JDK環(huán)境.
[root@localhost ~]# tar -xzvf jdk-8u171-linux-x64.tar.gz -C /usr/local/
[root@localhost ~]# mv /usr/local/jdk1.8.0_171/ /usr/local/jdk
[root@localhost ~]# vim /etc/profile
#------------------------------------------------------------------
#JAVA-JDK-PATH
export JAVA_HOME=/usr/local/jdk
export JAVA_BIN=/usr/local/jdk/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
#------------------------------------------------------------------
[root@localhost ~]# source /etc/profile
[root@localhost ~]# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
復(fù)制代碼
3.此步驟需要進(jìn)入每一個(gè)數(shù)據(jù)庫(kù)創(chuàng)建授權(quán)用戶,也就是給MyCAT準(zhǔn)備的使用數(shù)據(jù)庫(kù)的授權(quán)用戶.
[root@localhost ~]# mysql -uroot -p
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 10
Server version: 5.5.60-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MariaDB [(none)]> create database MyCatDB;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on MyCatDB.* to "MyCat"@"%" identified by "123123";
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> grant all on MyCatDB.* to "MyCat"@"localhost" identified by "123123";
Query OK, 0 rows affected (0.00 sec)
復(fù)制代碼
4.解壓MyCat工具,并修改MyCat用戶授權(quán)文件,寫入MyCat登陸賬戶,這里配置文件有很多選項(xiàng),我們不需要?jiǎng)?只需要修改以下幾個(gè)地方就行.
[root@localhost ~]# wget http://dl.mycat.io/1.6.5/Mycat-server-1.6.5-release-20180122220033-linux.tar.gz
[root@localhost ~]# tar -xzvf Mycat-server-1.6.5-release-20180122220033-linux.tar.gz -C /usr/local/
[root@localhost ~]# vim /usr/local/mycat/conf/server.xml
<user name="root" defaultAccount="true"> #指定MyCat登陸用戶名
<property name="password">123456</property> #指定密碼
<property name="schemas">MyCatDB</property> #指定同步數(shù)據(jù)庫(kù)
</user>
<user name="user"> #指定MyCat登陸用戶名
<property name="password">123456</property> #指定密碼
<property name="schemas">MyCatDB</property> #指定同步數(shù)據(jù)庫(kù)
<property name="readOnly">true</property> #指定只讀
</user>
復(fù)制代碼
5.修改MyCat讀寫分離策略,這里我們刪除源文件,并自己創(chuàng)建一個(gè),寫入以下內(nèi)容.
[root@localhost ~]# vim /usr/local/mycat/conf/schema.xml
<?xml version="1.0"?>
<!DOCTYPE mycat:schema SYSTEM "schema.dtd">
<mycat:schema xmlns:mycat="http://io.mycat/">
<schema name="MyCatDB" checkSQLschema="false" sqlMaxLimit="100" dataNode="dn_test"> </schema>
<dataNode name="dn_test" dataHost="localhost" database="MyCatDB" />
<dataHost name="localhost" maxCon="1000" minCon="10" balance="1" writeType="0" dbType="mysql" dbDriver="native" switchType="1" slaveThreshold="100">
<heartbeat>select user()</heartbeat>
<writeHost host="Master1" url="192.168.1.11:3306" user="MyCat" password="123123"> #配置寫主機(jī)
<readHost host="Slave1" url="192.168.1.12:3306" user="MyCat" password="123123" /> #配置讀主機(jī)
<readHost host="Slave2" url="192.168.1.13:3306" user="MyCat" password="123123" /> #配置讀主機(jī)
</writeHost>
</dataHost>
</mycat:schema>
復(fù)制代碼
6.啟動(dòng)MyCat若無(wú)報(bào)錯(cuò)則說(shuō)明啟動(dòng)成功,查看端口看虛擬端口是否開啟成功.
[root@localhost ~]# /usr/local/mycat/bin/mycat start
[root@localhost ~]#.NETstat -an |grep "9066" #虛擬schema管理端口
[root@localhost ~]# netstat -an |grep "8066" #虛擬schema登陸端口
復(fù)制代碼
7.在MyCat服務(wù)主機(jī)登陸數(shù)據(jù)庫(kù),測(cè)試同步效果.
[root@localhost ~]# mysql -uroot -p123456 -h 127.0.0.1 -P 9066
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.6.29-mycat-1.6.5-release-20180122220033 MyCat Server (monitor)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MySQL [(none)]> show @@heartbeat; #RS_CODE為1表示心跳正常
+---------+-------+--------------+------+---------+-------+--------+---------+--------------+---------------------+-------+
| NAME | TYPE | HOST | PORT | RS_CODE | RETRY | STATUS | TIMEOUT | EXECUTE_TIME | LAST_ACTIVE_TIME | STOP |
+---------+-------+--------------+------+---------+-------+--------+---------+--------------+---------------------+-------+
| Master1 | mysql | 192.168.1.11 | 3306 | -1 | 0 | idle | 0 | 0,16,16 | 2018-12-21 01:29:43 | false |
| Slave1 | mysql | 192.168.1.12 | 3306 | -1 | 0 | idle | 0 | 34,31,31 | 2018-12-21 01:29:43 | false |
| Slave2 | mysql | 192.168.1.13 | 3306 | -1 | 0 | idle | 0 | 1,16,16 | 2018-12-21 01:29:43 | false |
+---------+-------+--------------+------+---------+-------+--------+---------+--------------+---------------------+-------+
3 rows in set (0.00 sec)
MySQL [(none)]> show @@datasource; #查看讀寫分離的機(jī)器配置情況
+----------+---------+-------+--------------+------+------+--------+------+------+---------+-----------+------------+
| DATANODE | NAME | TYPE | HOST | PORT | W/R | ACTIVE | IDLE | SIZE | EXECUTE | READ_LOAD | WRITE_LOAD |
+----------+---------+-------+--------------+------+------+--------+------+------+---------+-----------+------------+
| dn_test | Master1 | mysql | 192.168.1.11 | 3306 | W | 0 | 0 | 1000 | 0 | 0 | 0 |
| dn_test | Slave1 | mysql | 192.168.1.12 | 3306 | R | 0 | 0 | 1000 | 0 | 0 | 0 |
| dn_test | Slave2 | mysql | 192.168.1.13 | 3306 | R | 0 | 0 | 1000 | 0 | 0 | 0 |
+----------+---------+-------+--------------+------+------+--------+------+------+---------+-----------+------------+
3 rows in set (0.01 sec)
MySQL [(none)]>
復(fù)制代碼
8.登錄MyCat代理端,測(cè)試讀寫分離服務(wù).
[root@localhost ~]# mysql -uroot -p123456 -h127.0.0.1 -P 8066
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MySQL connection id is 3
Server version: 5.6.29-mycat-1.6.5-release-20180122220033 MyCat Server (OpenCloundDB)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
MySQL [(none)]>
MySQL [(none)]>
MySQL [(none)]>
MySQL [(none)]> show databases;
+----------+
| DATABASE |
+----------+
| MyCatDB |
+----------+
1 row in set (0.00 sec)
MySQL [(none)]>
復(fù)制代碼
MySQL 增加監(jiān)控
1.首先我們先來(lái)下載MyCat以及Zookeeper.
[root@localhost ~]# wget http://www-eu.Apache.org/dist/zookeeper/zookeeper-3.4.12/zookeeper-3.4.12.tar.gz
[root@localhost ~]# wget http://dl.mycat.io/mycat-web-1.0/Mycat-web-1.0-SNAPSHOT-20170102153329-linux.tar.gz
復(fù)制代碼
2.在MyCat服務(wù)端安裝JDK環(huán)境,由于MyCat是使用Java開發(fā)的,在這里我們要先配置一下JDK環(huán)境.
[root@localhost ~]# tar -xzvf jdk-8u171-linux-x64.tar.gz -C /usr/local/
[root@localhost ~]# mv /usr/local/jdk1.8.0_171/ /usr/local/jdk
[root@localhost ~]# vim /etc/profile
#------------------------------------------------------------------
#JAVA-JDK-PATH
export JAVA_HOME=/usr/local/jdk
export JAVA_BIN=/usr/local/jdk/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
#------------------------------------------------------------------
[root@localhost ~]# source /etc/profile
[root@localhost ~]# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
復(fù)制代碼
3.配置MariaDB開啟lower_case_table_names選項(xiàng),每臺(tái)都要開啟.
[root@localhost ~]# yum install -y mariadb mariadb-server
[root@localhost ~]# vim /etc/my.cnf
[mysqld]
lower_case_table_names = 1
[root@localhost ~]# systemctl restart mariadb
復(fù)制代碼
4.安裝zookeeper,其主要用來(lái)統(tǒng)計(jì)數(shù)據(jù).
[root@localhost ~]# tar -xzvf zookeeper-3.4.12.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/zookeeper-3.4.12/conf/
[root@localhost ~]# cp zoo_sample.cfg zoo.cfg
[root@localhost ~]# vim zoo.cfg
dataDir=/usr/local/...
dataLogDir=/usr/local/...
復(fù)制代碼
5.運(yùn)行zookeeper
[root@localhost ~]# cd /usr/local/zookeeper-3.4.12/bin/
[root@localhost ~]# ./zkServer.sh start
[root@localhost ~]# netstat -ant | grep 2181
tcp 0 0 :::2181 :::* LISTEN
如果出現(xiàn)錯(cuò)誤:nohup: failed to run command `java’: No such file or directory
可以在zkServer.sh中的首行添加如下代碼
export JAVA_HOME=/usr/lib/jdk
export PATH=$JAVA_HOME/bin:$PATH
復(fù)制代碼
6.最后一步,安裝并運(yùn)行Mycat-Web
[root@localhost ~]# tar -xzvf Mycat-web-1.0-SNAPSHOT-20170102153329-linux.tar.gz -C /usr/local
[root@localhost ~]# cd /usr/local/mycat-web
[root@localhost ~]# ./start.sh &
[root@localhost ~]# netstat -an | grep "8082"
tcp 0 0 :::8082 :::* LISTEN
[root@localhost ~]# curl http://localhost:8082/mycat
復(fù)制代碼
轉(zhuǎn)載鏈接:
https://juejin.cn/post/7179906588549840955