Administration guide > Configure the deployment environment > Configuring deployment policies > Controlling shard placement with zones
View zone information with xsadmin
Use the xsadmin sample utility to view information about the current zone deployment, including shard placement data.
You can determine information about the configuration related to zone settings by using the xsadmin sample utility that ships with the product.
- Deploy a distributed data grid with multiple data centers.
- Use xsadmin to determine information about the shards of data
- Run the following command: xsadmin.bat -containers -empties
- The utility displays output:
*** Show all online containers for grid - Grid & mapset - mapSet Host: 184.108.40.206 Container: serverA0_C-3, Server:serverA0, Zone:zoneA P:0 Primary P:1 SynchronousReplica P:2 SynchronousReplica Container: serverA1_C-3, Server:serverA1, Zone:zoneA P:1 Primary P:2 Primary P:0 SynchronousReplica Container: serverB0_C-4, Server:serverB0, Zone:zoneB P:1 AsynchronousReplica P:2 AsynchronousReplica Container: serverB1_C-1, Server:serverB1, Zone:zoneB P:0 AsynchronousReplica
This output is from the multiple data centers scenario: Primary and synchronous replicas in the same zone, asynchronous replicas in remote zone use case. Four container servers: serverA0, serverA1, serverB0, and serverB1 exist in two zones: zoneA and zoneB. The data grid Grid is deployed, and it has the map set mapSet. The map set has three partitions defined. Production mode requires many more than three partitions, which are sufficient for development mode purposes. Primary and synchronous replica shards exist in the same zoneA zone, and asynchronous replicas exist in the zoneB zone.
ExampleYou can also run a simpler scenario by using the getting started sample: <installRoot>/ObjectGrid/gettingstarted. Read more about Run the getting started sample application with eXtreme Scale.
- Start a catalog server:
- Determine the required number of replicas, zone rules, containers, and other settings such as with the following command: startOgServer.bat serverA0 -objectgridFile xml\objectgrid.xml -deploymentPolicyFile xml\deployment.xml -zone zoneA
- You can stop container processes to simulate failure in the data grid: stopOgServer.bat serverA0,serverA1,serverB0 -catalogServiceEndPoints localhost:2809.
If the server that contains the last shard of a partition is stopped, eXtreme Scale allocates a new primary shard. You can check for data loss:
- The runclient script inserts and reads item in the data grid.
- The xsadmin -mapsizes command shows the number of items in the data grid.
- Show active containers with the -empties parameter for xsadmin. The utility displays output such...
*** Show all online containers for grid - Grid & mapset - mapSet Host: 220.127.116.11 Container: serverA0_C-0, Server:serverA0, Zone:zoneA P:0 Primary P:1 Primary P:2 Primary Container: serverA1_C-0, Server:serverA1, Zone:zoneA
In this example, serverA1 currently has no shards. The example is based on a deployment using the gettingstarted sample deployment policy XML file with three partitions but no zone rules. Two container servers were started and assigned to zoneA. Although the deployment policy XML file is configured for one synchronous replica, none is allocated because of Rule 2. In this case, you need another zone in which to allocate the replica.
To stop all container servers, use the following command: xsadmin.bat -teardown. The utility displays a list of containers to be stopped and prompts you to continue: Yes or No.
To stop all container servers and the catalog server: xsadmin.bat -teardown <catalog_server_name>
The name of the catalog server in the gettingstarted sample is cs0.
Parent topic:Controlling shard placement with zones