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节点信息,并且可实时禁用。
从库信息界面主要是读写分离的信息: