ShardingSphere提供了界面治理模塊——sharding-ui,通過sharding-ui可以快速維護sharding-proxy集羣。
一、安裝
1.下載
https://shardingsphere.apache.org/document/current/cn/downloads/
2.安裝和配置
(1)解壓:
[root@app1 powersql]# tar -xf apache-shardingsphere-incubating-4.0.0-sharding-ui-bin.tar.gz
[root@app1 powersql]# ll
total 23064
drwxr-xr-x 6 root root 103 Feb 28 15:23 apache-shardingsphere-incubating-4.0.0-sharding-ui-bin
-rw-r--r-- 1 root root 23615313 Feb 28 15:23 apache-shardingsphere-incubating-4.0.0-sharding-ui-bin.tar.gz
(2)進入程序目錄並運行
[root@app1 powersql]# cd apache-shardingsphere-incubating-4.0.0-sharding-ui-bin
[root@app1 powersql]# bin/start.sh
sharding-ui是一個標準的springboot程序,可以通過conf/application.properties
配置相關信息:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
server.port=8088
user.admin.username=admin
user.admin.password=admin
這裏是下面要用到的連接配置信息,端口、用戶名和密碼可在此修改。
二、配置與使用
輸入你部署的服務器的ip地址:8088進入管理界面。
例如我的地址是: http://172.18.100.33:8088
默認用戶名和密碼是: admin/admin
1.添加註冊中心
這裏對應server.yaml
中的配置,不多贅述,如圖:
2.配置管理
這裏可以進行公共信息
、認證信息
及分表分庫
的配置,可實時生效。
3.運行狀態
這裏可以看到連接的sharding-proxy節點信息,並且可實時禁用。
從庫信息界面主要是讀寫分離的信息: