Display YugabyteDB Universe Cluster Configuration Details in HTML, JSON or Text Formats from the Command Line

The cluster configuration in YugabyteDB provides information about the current state of the cluster. It includes details about the replication settings, placement of replicas, and other configuration parameters.

We can view the cluster configuration from the command line using the yb-admin command line tool or hitting an http endpoint.

The option used depends on the format of the outout you desire.

For JSON output, use yb-admin or curl the MASTER_IP:7000/api/v1/cluster-config end point.

				
					# yb-admin -master-addresses 127.0.0.1 get_universe_config
{"version":4,"replicationInfo":{"liveReplicas":{"numReplicas":3,"placementBlocks":[{"cloudInfo":{"placementCloud":"aws","placementRegion":"us-west-1","placementZone":"us-west-1a"},"minNumReplicas":1},{"cloudInfo":{"placementCloud":"aws","placementRegion":"ca-central-1","placementZone":"ca-central-1a"},"minNumReplicas":1},{"cloudInfo":{"placementCloud":"aws","placementRegion":"us-east-1","placementZone":"us-east-1a"},"minNumReplicas":1}],"placementUuid":"YzIxMTg2ZWQtNmNhYy00MGEwLWIxODQtOGEwNWY0MTdhN2Mw"}},"clusterUuid":"113a3d30-9073-45e0-8983-3f2277432abe","universeUuid":"39cd8628-f0d3-49b9-ba2d-cbb3a03cb58e"}
				
			
				
					# curl -s 127.0.0.1:7000/api/v1/cluster-config
{"version":4,"replication_info":{"live_replicas":{"num_replicas":3,"placement_blocks":[{"cloud_info":{"placement_cloud":"aws","placement_region":"us-west-1","placement_zone":"us-west-1a"},"min_num_replicas":1},{"cloud_info":{"placement_cloud":"aws","placement_region":"ca-central-1","placement_zone":"ca-central-1a"},"min_num_replicas":1},{"cloud_info":{"placement_cloud":"aws","placement_region":"us-east-1","placement_zone":"us-east-1a"},"min_num_replicas":1}],"placement_uuid":"c21186ed-6cac-40a0-b184-8a05f417a7c0"}},"cluster_uuid":"113a3d30-9073-45e0-8983-3f2277432abe","universe_uuid":"39cd8628-f0d3-49b9-ba2d-cbb3a03cb58e"}





				
			

For HTML output, curl the MASTER_IP:7000/cluster-config end point:

				
					# curl -s yugabytedb.tech:7000/cluster-config
<!DOCTYPE html><html>  <head>    <title>YugabyteDB</title>    <link rel='shortcut icon' href='/favicon.ico'>    <link href='/bootstrap/css/bootstrap.min.css' rel='stylesheet' media='screen' />    <link href='/bootstrap/css/bootstrap-theme.min.css' rel='stylesheet' media='screen' />    <link href='/font-awesome/css/font-awesome.min.css' rel='stylesheet' media='screen' />    <link href='/yb.css' rel='stylesheet' media='screen' />    <script src='/libs/jquery/3.7.0/jquery-3.7.0.min.js'></script>    <script type='text/javascript' src='/collapse.js'></script>  </head>
<body>
  <nav class="navbar navbar-fixed-top navbar-inverse sidebar-wrapper" role="navigation">    <ul class="nav sidebar-nav">      <li><a href='/'><img src='/logo.png' alt='YugabyteDB' class='nav-logo' /></a></li>
<li class='nav-item'><a href='/'><div><i class='fa fa-home'aria-hidden='true'></i></div>Home</a></li>
<li class='nav-item'><a href='/namespaces'><div><i class='fa fa-table'aria-hidden='true'></i></div>Namespaces</a></li>
<li class='nav-item'><a href='/tables'><div><i class='fa fa-table'aria-hidden='true'></i></div>Tables</a></li>
<li class='nav-item'><a href='/tablet-servers'><div><i class='fa fa-server'aria-hidden='true'></i></div>Tablet Servers</a></li>
<li class='nav-item'><a href='/utilz'><div><i class='fa fa-wrench'aria-hidden='true'></i></div>Utilities</a></li>
    </ul>  </nav>

    <div class='yb-main container-fluid'><h1>Current Cluster Config</h1>
<div class="alert alert-success">Successfully got cluster config!</div><pre class="prettyprint">version: 4<br/>replication_info {<br/>  live_replicas {<br/>    num_replicas: 3<br/>    placement_blocks {<br/>      cloud_info {<br/>        placement_cloud: &quot;aws&quot;<br/>        placement_region: &quot;us-west-1&quot;<br/>        placement_zone: &quot;us-west-1a&quot;<br/>      }<br/>      min_num_replicas: 1<br/>    }<br/>    placement_blocks {<br/>      cloud_info {<br/>        placement_cloud: &quot;aws&quot;<br/>        placement_region: &quot;ca-central-1&quot;<br/>        placement_zone: &quot;ca-central-1a&quot;<br/>      }<br/>      min_num_replicas: 1<br/>    }<br/>    placement_blocks {<br/>      cloud_info {<br/>        placement_cloud: &quot;aws&quot;<br/>        placement_region: &quot;us-east-1&quot;<br/>        placement_zone: &quot;us-east-1a&quot;<br/>      }<br/>      min_num_replicas: 1<br/>    }<br/>    placement_uuid: &quot;c21186ed-6cac-40a0-b184-8a05f417a7c0&quot;<br/>  }<br/>}<br/>cluster_uuid: &quot;113a3d30-9073-45e0-8983-3f2277432abe&quot;<br/>universe_uuid: &quot;39cd8628-f0d3-49b9-ba2d-cbb3a03cb58e&quot;<br/></pre><div class='yb-bottom-spacer'></div></div>
<footer class='footer'><div class='yb-footer container text-muted'><pre class='message'><i class="fa-lg fa fa-gift" aria-hidden="true"></i> Congratulations on installing YugabyteDB. We'd like to welcome you to the community with a free t-shirt and pack of stickers! Please claim your reward here: <a href='https://www.yugabyte.com/community-rewards/'>https://www.yugabyte.com/community-rewards/</a></pre><pre>version 2.20.4.0 build 50 revision bf5b144a7fb13f40bd4b7a022934a3af14894379 build_type RELEASE built at 20 May 2024 18:42:14 UTC
server uuid 95edddb12f8644a293570003563e2bc5 local time 2024-07-12 14:19:40.334823</pre></div></footer></body></html>
				
			

For Plain Text output, use a tool like the Linux lynx command to query the MASTER_IP:7000/cluster-config end point:  

				
					# lynx --dump http://127.0.0.1:7000/cluster-config | awk '/version:/,/universe_uuid:/'
version: 4
replication_info {
  live_replicas {
    num_replicas: 3
    placement_blocks {
      cloud_info {
        placement_cloud: "aws"
        placement_region: "us-west-1"
        placement_zone: "us-west-1a"
      }
      min_num_replicas: 1
    }
    placement_blocks {
      cloud_info {
        placement_cloud: "aws"
        placement_region: "ca-central-1"
        placement_zone: "ca-central-1a"
      }
      min_num_replicas: 1
    }
    placement_blocks {
      cloud_info {
        placement_cloud: "aws"
        placement_region: "us-east-1"
        placement_zone: "us-east-1a"
      }
      min_num_replicas: 1
    }
    placement_uuid: "c21186ed-6cac-40a0-b184-8a05f417a7c0"
  }
}
cluster_uuid: "113a3d30-9073-45e0-8983-3f2277432abe"
universe_uuid: "39cd8628-f0d3-49b9-ba2d-cbb3a03cb58e"
				
			

Have Fun!

Not sure about your neighborhood, but in mine, there’s suddenly a car wash on almost every block! I thought I'd try one...