此内容没有您所选择的语言版本。

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.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat