Questo contenuto non è disponibile nella lingua selezionata.

6.3.2. Creating and Populating Districts


Use the oo-admin-ctl-district command on the broker host to administer districts.

Note

Districts work with gear profiles to manage nodes. A default gear profile is defined in the /etc/openshift/broker.conf file on the broker host, and is created in the following procedure. For information on how to change the default gear profile, see Section 6.1, “Adding or Modifying Gear Profiles”.

Procedure 6.3. To Create and Populate Districts:

  1. Create a district using the following command:
    # oo-admin-ctl-district -c create -n District_Name -p Gear_Profileoo-admin-ctl-district -c create -n District_Name -p Gear_Profileoo-admin-ctl-district -c create -n District_Name -p Gear_Profileoo-admin-ctl-district -c create -n District_Name -p Gear_Profile
    Copy to Clipboard Toggle word wrap
  2. Add a node to the district using the following command:
    # oo-admin-ctl-district -c add-node -n District_Name -i Node_Hostnameoo-admin-ctl-district -c add-node -n District_Name -i Node_Hostnameoo-admin-ctl-district -c add-node -n District_Name -i Node_Hostnameoo-admin-ctl-district -c add-node -n District_Name -i Node_Hostname
    Copy to Clipboard Toggle word wrap
Alternatively, create a district and add nodes to it simultaneously with the following command. Note that you can add multiple node hosts with the -i option and any node hostnames, or use the --available option to add all undistricted nodes of the specified size:
# oo-admin-ctl-district -c add-node -n District_Name -p Gear_Profile -i Node_Hostname1,Node_Hostname2oo-admin-ctl-district -c add-node -n District_Name -p Gear_Profile -i Node_Hostname1,Node_Hostname2oo-admin-ctl-district -c add-node -n District_Name -p Gear_Profile -i Node_Hostname1,Node_Hostname2oo-admin-ctl-district -c add-node -n District_Name -p Gear_Profile -i Node_Hostname1,Node_Hostname2oo-admin-ctl-district -c add-node -n District_Name -p Gear_Profile -i Node_Hostname1,Node_Hostname2oo-admin-ctl-district -c add-node -n District_Name -p Gear_Profile -i Node_Hostname1,Node_Hostname2oo-admin-ctl-district -c add-node -n District_Name -p Gear_Profile -i Node_Hostname1,Node_Hostname2oo-admin-ctl-district -c add-node -n District_Name -p Gear_Profile -i Node_Hostname1,Node_Hostname2
Copy to Clipboard Toggle word wrap
The following examples use the small gear profile to create a district named small_district, then add the node host node1.example.com to the new district:

Example 6.3. Creating a District Named small_district:

# oo-admin-ctl-district -c create -n small_district -p small

Successfully created district: 7521a7801686477f8409e74f67b693f4

{"_id"=>"53443b8b87704f23db000001",
 "active_servers_size"=>1,
 "available_capacity"=>6000,
 "available_uids"=>"<6000 uids hidden>",
 "created_at"=>2014-04-08 18:10:19 UTC,
 "gear_size"=>"small",
 "max_capacity"=>6000,
 "max_uid"=>6999,
 "name"=>"default-small-0",
 "servers"=> [],
 "updated_at"=>2014-04-08 18:10:19 UTC,
 "uuid"=>"53443b8b87704f23db000001"}
Copy to Clipboard Toggle word wrap

Example 6.4. Adding node1.example.com to the District:

# oo-admin-ctl-district -c add-node -n small_district -i node1.example.com

Success!

{"_id"=>"53443b8b87704f23db000001",
 "active_servers_size"=>1,
 "available_capacity"=>6000,
 "available_uids"=>"<6000 uids hidden>",
 "created_at"=>2014-04-08 18:10:19 UTC,
 "gear_size"=>"small",
 "max_capacity"=>6000,
 "max_uid"=>6999,
 "name"=>"default-small-0",
 "servers"=>
  [{"_id"=>"53443bbc87704f49bd000001",
    "active"=>true,
    "name"=>"node1.example.com",
    "unresponsive"=>false}],
 "updated_at"=>2014-04-08 18:10:19 UTC,
 "uuid"=>"53443b8b87704f23db000001"}
Copy to Clipboard Toggle word wrap

Important

The server identity, node1.example.com in the above example, is the node's host name as configured on that server, which could be different from the PUBLIC_HOSTNAME configured in the /etc/openshift/node.conf file on the node. CNAME records use the PUBLIC_HOSTNAME parameter, which must resolve to the host through DNS; the host name could be something completely different and may not resolve in DNS at all.
 
MongoDB records the host name both in the district and with any gears hosted on the node host, so changing the node's host name disrupts the broker's ability to use the node. Red Hat recommends using the host name as the DNS name and not changing either after deployment.
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat