Back to Yugabyte Db

README

managed/README.md

2026.1.0.0-b253.5 KB
Original Source

Overview

The YugabyteDB Anywhere console is used in a highly available mode and orchestrates and manages YugabyteDB universes, or clusters, on one or more regions (across public cloud and private on-premises data centers).

For more details, see https://docs.yugabyte.com/latest/yugabyte-platform/overview/

Building and running locally

  1. Make sure you have run initial setup via <a href='https://github.com/yugabyte/internal-devops/blob/master/bin/setup_workstation.sh'>setup_workstation.sh --yugaware</a>. It will install all the required dev tools + will create local PG and Prometheus docker containers, required for YBA to run locally.
  2. Fill in /opt/yugabyte/yw-build-env.sh with your data and make sure it's included into .bashrc.
  3. Run sbt compilePlatform to build and sbt runPlatform to run.
  4. In case startup fails - make sure you can connect to local PG instance via PGPASSWORD=$DB_PASSWORD psql -d yugaware -U postgres -h 127.0.0.1.
  5. Also make sure your local Prometheus is running and attempts to scrape 'promtheus' and 'platform' <a href='http://localhost:9090/targets'>targets</a>.

Running unit tests locally

  1. To run all tests, use sbt test
  2. To run particular test(s), use test:testOnly *<some_test>Test

Development with Intellij IDEA

Install and configure IDEA

  1. Download and install Intellij Idea from <a href='https://www.jetbrains.com/idea/download'>here</a> (if you have Ultimate license) or <a href='https://github.com/JetBrains/intellij-community/releases'>here</a> (Community edition). You can use Community Edition - it mostly has all the functionality needed.
  2. Launch Intellij Idea.
  3. Go to File -> Project structure -> SDKs. Import JDK you’re going to use to run builds/YBA in dev mode. You need JDK 17.
  4. Go to Intellij Idea -> Settings:
  • General -> Editor -> Auto import -> check ‘Optimize imports on the fly’
  • Plugins -> install ‘HOCON’, ‘Python Community Edition’, ‘Scala’ and ‘Lombok’ plugins.

Import YBA project

  1. Build project with sbt cleanPlatform compilePlatform. This is required because not all the tasks are executed by Idea, seems like, but artifacts are needed for the build.
  2. File -> New -> Project from existing sources
  3. Point to managed directory
  4. Import project from existing model -> BSP -> sbt (recommended)
  5. Wait for the project to import
  6. Try to do Build -> Build project to make sure import is successful

Remote debug

  1. Run platform in terminal via: sbt -jvm-debug 9999 debug runPlatform
  2. Go to Run -> Debug -> Edit configurations -> + (Add new configuration) -> Application
  3. Use the following values in the run config:
Name: yba
Host: localhost
Port: 9999
Use module classpath: root
  1. Click Debug.
  2. Put breakpoints in your code and make sure it stops on breakpoints when this code is reached.

Running tests

  1. Find any test in Project view and debug it via Debug -> Test_name. Same can be done for a particular test method as well.
  2. You can stop on breakpoints and check variable values, add watches, etc.

Misc

  1. Sometimes Idea cache may break so that it shows errors in places, which does not have them, can’t find classes which are there, etc -> typically this means that project cache is broken. You need to clean it via File -> Invalidate caches.
  2. Another possibility is that some classes, which are not generated by Idea, but are generated by SBT are missing. In this case run sbt cleanPlatform compilePlatform, and click Sync All BSP projects in Idea.