ShardingSphere 4.x -Sharding-UI

Introduction

Sharding-UI is a simple and useful web administration console for ShardingSphere. It is designed to help users more easily use ShardingSphere, and currently provides ability of registry center management, dynamic configuration management, database orchestration, etc.

The frontend of project uses vue as javascript framework and the backend is a standard spring boot project. You can deploy it with maven, and also run locally by separating the frontend and backend.

Navigation

This chapter will introduce the use of Sharding-UI.

Build

Binary Run

  1. git clone https://github.com/apache/shardingsphere.git;
  2. Run mvn clean install -Prelease;
  3. Get the package in /sharding-distribution/shardingsphere-ui-distribution/target/apache-shardingsphere-${latest.release.version}-sharding-ui-bin.tar.gz;
  4. After the decompression, run bin/start.sh;
  5. visit http://localhost:8088/.

Source Code Debug

Sharding-UI use frontend and backend separately mode.

backend

  1. Main class is org.apache.shardingsphere.ui.Bootstrap;
  2. visit http://localhost:8088/.

frontend

  1. cd sharding-ui-frontend/;
  2. run npm install;
  3. run npm run dev;
  4. visit http://localhost:8080/.

Configuration

Configuration file of Sharding-UI is conf/application.properties in distribution package. It is constituted by two parts.

  1. Listening port;
  2. authentication.
server.port=8088user.admin.username=admin
user.admin.password=admin

Notices

  1. If you run the frontend project locally after a build with maven, you may fail to run it due to inconsistent version of node. You can clean up node_modules/ directory and run it again. The error log is:
ERROR  Failed to compile with 17 errors
error in ./src/views/orchestration/module/instance.vue?vue&type=style&index=0&id=9e59b740&lang=scss&scoped=true&
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Missing binding /sharding-sphere/sharding-ui/sharding-ui-frontend/node_modules/node-sass/vendor/darwin-x64-57/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 8.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 6.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.

Config Center

Config Center Configuration

The config center needs to be added and activated first. Multiple centers can be added, but only one is active, and the following rule config operate on the currently active config center. Zookeeper support is provided now, and the support for other config centers will be added later.

Rule Config

  • After added and activated a config center, the configuration of all data sources in the current active config center can be obtained, including data sharding, read-write split, properties, and so on.
  • The configuration can be modified by the YAML format.
  • Click the + button to add a new data source and sharding rule.

Registry Center

Registry Center Configuration

The registry center needs to be added and activated first. Multiple registries can be added, but only one is active, and the following runtime status operate on the currently active registry. Zookeeper support is provided now, and the support for other registries will be added later.

Runtime Status

  • After added and activated a registry center, all running instances of the current registry center will be obtained.
  • Users can disable or enable the instance by operate button.
  • Users can disable or enable the access to slave database.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Apache ShardingSphere

Apache ShardingSphere

Transform any DBMS in a distributed database system & enhance it with sharding, elastic scaling features & more. https://linktr.ee/ApacheShardingSphere