Skip to content

pingcap/tiunimanager

Repository files navigation


logo

TiUniManager

License

TiUniManager is a database management platform built for operating and managing TiDB, a distributed database.

It allows users to manage TiDB clusters through OpenAPI or TiUniManager UI, the web-based UI.

Contents

  • library - Common components and resources.
  • micro-api - OpenAPI http handler.
  • micro-cluster - Core service.
  • docs - Documentation.

Deploy TiUniManager

Prerequisites

The followings are required for developing TiUniManager:

Preparation

Before you can actually run the service, you need to prepare TiUP and certs.

Prepare TiUP

  1. Install TiUP by following instructions in Deploy TiUP on the control machine.

  2. Prepare TIUP_HOME which will be used by TiUniManger.

    $ mkdir -p /home/tidb/.tiup/bin
    $ TIUP_HOME=/home/tidb/.tiup tiup mirror set https://tiup-mirrors.pingcap.com

Prepare certs

You need to prepare the following certs in the directory ./bin/cert, where aes.key contains a 32 character string.

  • aes.key
  • etcd-ca.pem
  • etcd-server-key.pem
  • etcd-server.pem
  • server.crt
  • server.csr
  • server.key

You can follow GENERATE CERTS to generate these certs.

Build and Run TiUniManager

  1. TiUniManager can be compiled and used on Linux, OSX, CentOS, It is as simple as:

    make
    
  2. start cluster-server

    ./bin/cluster-server --host=127.0.0.1 --port=4101 --metrics-port=4104 --registry-address=127.0.0.1:4106 --elasticsearch-address=127.0.0.1:4108 --skip-host-init=true --em-version=InTesting --deploy-user=tidb --deploy-group=tidb

    NOTICE:

    • --skip-host-init=true is necessary as deploying TiUniManager using built binary will not help configure SSH login without password, and you need to refer step Configure SSH login without password in DEPLOY TiDB to do so.
    • --skip-host-init is set false while deploying TiUniManager using TiUP, please refer TiUniManager install and maintain
  3. open a new terminal, then start openapi-server

    ./bin/openapi-server --host=127.0.0.1 --port=4100 --metrics-port=4103 --registry-address=127.0.0.1:4106

Try it out

Now you can check API using Swagger: http://127.0.0.1:4100/swagger/index.html, and you can use TiUniManager to DEPLOY TiDB.

Interested in contributing?

Read through our contributing guidelines to learn about our submission process and more.

License

Copyright 2022 PingCAP. All rights reserved.

Licensed under the Apache 2.0 License.