create

Create async-event-queues, disk-stores, gateway receivers, gateway senders, indexes, and regions.

  • create async-event-queue

    Creates an asynchronous event queue for batching events before they are delivered by a gateway sender.

  • create defined indexes

    Creates all the defined indexes.

  • create disk-store

    Defines a pool of one or more disk stores, which can be used by regions and client subscription queues, and gateway sender queues for WAN distribution.

  • create gateway-receiver

    Creates a gateway receiver. You can only have one gateway receiver on each member, and unlike a gateway sender, you do not need to specify an identifier for the gateway receiver .

  • create gateway-sender

    Creates a gateway sender on one or more members of a distributed system.

  • create index

    Create an index that can be used when executing queries.

  • create lucene index

    Create a region with given path and configuration.

  • create region

    Create a region with given path and configuration.

create async-event-queue

Creates an asynchronous event queue for batching events before they are delivered by a gateway sender.

See Configuring Multi-Site (WAN) Event Queues.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:

create async-event-queue --id=value --listener=value [--group=value(nullvalue)*]
    [--parallel(=value)?] [--enable-batch-conflation(=value)?] [--batch-size=value]
    [--batch-time-interval=value] [--persistent(=value)?] [--disk-store=value]
    [--disk-synchronous(=value)?] [--max-queue-memory=value]
    [--dispatcher-threads=value] [--order-policy=value]
    [--gateway-event-filter=value(,value)*]
    [--gateway-event-substitution-filter=value] 
    [--listener-param=value(,value)*]

Parameters, create async-event-queue:

Name Description Default Value
\-\-id Required. ID of the asynchronous event queue
\-\-group The queue is created on all members of this group. If you do not specify a group the queue is created on all members.
\-\-parallel Specifies whether the queue is parallel. false
\-\-enable-batch-conflation Enables batch conflation. false
\-\-batch-size Maximum number of messages that a batch can contain. 100
\-\-batch-time-interval Maximum amount of time, in ms, that can elapse before a batch is delivered. 5
\-\-persistent Boolean value that determines whether Geode persists this queue. false

If specified with out a value, default is true.

\-\-disk-store Named disk store to use for storing queue overflow, or for persisting the queue. If you specify a value, the named disk store must exist. If you specify a null value, Geode uses the default disk store for overflow and queue persistence.
\-\-disk-synchronous Specifies whether disk writes are synchronous. true
\-\-max-queue-memory Maximum amount of memory in megabytes that the queue can consume before overflowing to disk. 100
\-\-dispatcher-threads Number of threads used for sending events. 5
\-\-order-policy Policy for dispatching events when \-\-dispatcher-threads is > 1. Possible values are THREAD, KEY, PARTITION. KEY
\-\-gateway-event-filter List of fully qualified class names of GatewayEventFilters for this queue. These classes filter events before dispatching to remote servers.
\-\-gateway-event-substitution-filter Fully-qualified class name of the GatewayEventSubstitutionFilter for this queue.
\-\-listener Required. Fully-qualified class name of Async Event Listener for this queue
\-\-listener-param Parameter name and value to be passed to the Async Event Listener class. Optionally, you can specify a value by following the parameter name with the # character and the value. For example:
--listener-param=myParam#24
\-\-forward-expiration-destroy Enables forwarding of expiration destroy operations to AsyncEventListener instances. If specified without a value, this parameter is set to “false”. false

Example Commands:

create async-event-queue --id=myAEQ --listener=myApp.myListener

create defined indexes

Creates all the defined indexes.

See also define index and clear defined indexes.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:

create defined indexes [--member=value] [--group=value]

Parameters, create defined indexes:

Name Description Default
\-\-member Name/Id of the member on which index will be created.
\-\-group The index will be created on all the members in this member group.

Example Commands:

create defined indexes

Sample Output:

gfsh>create defined indexes
Indexes successfully created. Use list indexes to get details.
1. ubuntu(server1:17682)<v1>:27574

If index creation fails, you may receive an error message in gfsh similar to the following:

gfsh>create defined indexes
Exception : org.apache.geode.cache.query.RegionNotFoundException , 
Message : Region ' /r3' not found: from  /r3Occurred on following members
1. india(s1:17866)<v1>:27809

create disk-store

Defines a pool of one or more disk stores, which can be used by regions and client subscription queues, and gateway sender queues for WAN distribution.

See Disk Storage

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:

create disk-store --name=value --dir=value(,value)* [--allow-force-compaction(=value)?] 
[--auto-compact(=value)?] [--compaction-threshold=value] [--max-oplog-size=value]
[--queue-size=value] [--time-interval=value] [--write-buffer-size=value] [--group=value(,value)*] 
[--disk-usage-warning-percentage=value] [--disk-usage-critical-percentage=value]

Parameters, create disk-store:

Name Description Default Value
\-\-name Required. The name of this disk store.
\-\-dir Required. One or more directory names where the disk store files are written. Optionally, directory names may be followed by # and the maximum number of megabytes that the disk store can use in the directory. For example:
--dir=/data/ds1 
--dir=/data/ds2#5000
If the specified directory does not exist, the command will create the directory for you.
\-\-allow-force-compaction Set to true to allow disk compaction to be forced on this disk store. false
\-\-auto-compact Set to true to automatically compact the disk files. true
\-\-compaction-threshold Percentage of garbage allowed before the disk store is eligible for compaction. 50
\-\-max-oplog-size Maximum size, in megabytes, for an oplog file. When the oplog file reaches this size, the file is rolled over to a new file. 1024
\-\-queue-size Maximum number of operations that can be asynchronously queued to be written to disk. 0
\-\-time-interval The number of milliseconds that can elapse before unwritten data is written to disk. 1000
--group The name of a group of distributed system members. The disk store is created on all members of this group. If no group is specified, the disk store is created on all members.
\-\-write-buffer-size The size of the write buffer that this disk store uses when writing data to disk. Larger values may increase performance but use more memory. The disk store allocates one direct memory buffer of this size. 32768
\-\-disk-usage-warning-percentage Disk usage above this threshold generates a warning message. For example, if the threshold is set to 90%, then on a 1 TB drive falling under 100 GB of free disk space generates the warning.

Set to "0" (zero) to disable.

90
\-\-disk-usage-critical-percentage Disk usage above this threshold generates an error message and shuts down the member's cache. For example, if the threshold is set to 99%, then falling under 10 GB of free disk space on a 1 TB drive generates the error and shuts down the cache.

Set to "0" (zero) to disable.

99

Example Commands:

create disk-store --name-store1 --dir=/data/ds1

Sample Output:

gfsh>create disk-store --name-store1 --dir=/data/ds1
Member  | Result
server1 | Success

create gateway-receiver

Creates a gateway receiver. You can only have one gateway receiver on each member, and unlike a gateway sender, you do not need to specify an identifier for the gateway receiver.

See Gateway Receivers.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:

create gateway-receiver [--group=value(,value)*] [--member=value(,value)*] 
  [--manual-start=value] [--start-port=value] [--end-port=value] [--bind-address=value] 
  [--maximum-time-between-pings=value] [--socket-buffer-size=value]
  [--gateway-transport-filter=value(,value)*]

Parameters, create gateway-receiver:

Name Description Default Value
\-\-group Gateway receivers are created on the members of this group.
\-\-member Name of the distributed system member on which to create the gateway receiver.
\-\-manual-start Boolean value that specifies whether you need to manually start the gateway receiver. If you supply a null value, the default is "true" and you will need to start the gateway receiver manually. true
\-\-start-port

Starting port number to use when specifying the range of possible port numbers this gateway receiver will use to connects to gateway senders in other sites. Geode chooses an unused port number in the specified port number range to start the receiver. If no port numbers in the range are available, an exception is thrown.

The STARTPORT value is inclusive while the ENDPORT value is exclusive. For example, if you specify STARTPORT="50510" and ENDPOINT="50520", Geode chooses a port value from 50510 to 50519.

5000
\-\-end-port

Defines the upper bound port number to use when specifying the range of possible port numbers this gateway receiver will use to for connections from gateway senders in other sites. Geode chooses an unused port number in the specified port number range to start the receiver. If no port numbers in the range are available, an exception is thrown.

The ENDPORT value is exclusive while the STARTPORT value is inclusive. For example, if you specify STARTPORT="50510" and ENDPOINT="50520", Geode chooses a port value from 50510 to 50519.

5500
\-\-bind-address Network address for connections from gateway senders in other sites. Specify the address as a literal string value.
\-\-socket-buffer-size An integer value that sets the buffer size (in bytes) of the socket connection for this gateway receiver. This value should match the socket-buffer-size setting of gateway senders that connect to this receiver. 32768
\-\-gateway-transport-filter The fully qualified class name of the GatewayTransportFilter to be added to the Gateway receiver.
\-\-maximum-time-between-pings Integer value that specifies the time interval (in milliseconds) to use between pings to connected WAN sites. This value determines the maximum amount of time that can elapse before a remote WAN site is considered offline. 60000

Example Commands:

gfsh>create gateway-receiver --member=server1

Sample Output:

gfsh>create gateway-receiver --member=server1
Member  | Status
server1 | GatewayReceiver created on member "server1" and will listen on the port "0"

create gateway-sender

Creates a gateway sender on one or more members of a distributed system.

See Gateway Senders.

Note: The gateway sender configuration for a specific sender id must be identical on each Geode member that hosts the gateway sender.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:

create gateway-sender --id=value --remote-distributed-system-id=value 
   [--group=value(,value)*] [--member=value(,value)*] [--parallel=value] 
   [--manual-start=value] [--socket-buffer-size=value] [--socket-read-timeout=value] 
   [--enable-batch-conflation=value] [--batch-size=value] [--batch-time-interval=value]
   [--enable-persistence=value] [--disk-store-name=value] [--disk-synchronous=value] 
   [--maximum-queue-memory=value] [--alert-threshold=value] [--dispatcher-threads=value] 
   [--order-policy=value][--gateway-event-filter=value(,value)*] 
   [--gateway-transport-filter=value(,value)*]

Parameters, create gateway-sender:

Name Description Default
\-\-id Required. Unique identifier for the gateway sender, usually an identifier associated with a physical location.
\-\-remote-distributed-system-id Required. ID of the remote distributed system where this gateway sender sends events.
\-\-group Gateway senders are created on the members of this group.
\-\-member Name of the distributed system member on which to create the gateway sender.
\-\-parallel When set to true, specifies a parallel Gateway Sender. false
\-\-enable-batch-conflation Boolean value that determines whether Geode should conflate messages. false
\-\-manual-start Boolean value that specifies whether you need to manually start the gateway sender. If you supply a null value, the default is "false" and the gateway sender attempts to start automatically. false
\-\-socket-buffer-size Size of the socket buffer that sends messages to remote sites. This size should match the size of the socket-buffer-size attribute of remote gateway receivers that process region events. 32768
\-\-socket-read-timeout Amount of time in milliseconds that the gateway sender will wait to receive an acknowledgment from a remote site. By default this is set to 0, which means there is no timeout. If you do set this timeout, you must set it to a minimum of 30000 (milliseconds). Setting it to a lower number will generate an error message and reset the value to the default of 0. 0
\-\-batch-size Maximum number of messages that a batch can contain. 100
\-\-batch-time-interval Maximum number of milliseconds that can elapse between sending batches. 1000
\-\-enable-persistence Boolean value that determines whether Geode persists the gateway queue. false
\-\-disk-store-name Named disk store to use for storing the queue overflow, or for persisting the queue. If you specify a value, the named disk store must exist. If you specify a null value, Geode uses the default disk store for overflow and queue persistence.
\-\-disk-synchronous For regions that write to disk, boolean that specifies whether disk writes are done synchronously for the region. true
\-\-maximum-queue-memory Maximum amount of memory in megabytes that the queue can consume before overflowing to disk. 100 MB
\-\-alert-threshold Maximum number of milliseconds that a region event can remain in the gateway sender queue before Geode logs an alert. 0
\-\-dispatcher-threads Number of dispatcher threads that are used to process region events from a gateway sender queue or asynchronous event queue. 5
\-\-order-policy When the dispatcher-threads attribute is greater than 1, order-policy configures the way in which multiple dispatcher threads process region events from a serial gateway queue or serial asynchronous event queue. This attribute can have one of the following values:
key
When distributing region events from the local queue, multiple dispatcher threads preserve the order of key updates.
thread
When distributing region events from the local queue, multiple dispatcher threads preserve the order in which a given thread added region events to the queue.
partition
When distributing region events from the local queue, multiple dispatcher threads preserve the order in which region events were added to the local queue. For a partitioned region, this means that all region events delivered to a specific partition are delivered in the same order to the remote Geode site. For a distributed region, this means that all key updates delivered to the local gateway sender queue are distributed to the remote site in the same order.

You cannot configure the order-policy for a parallel event queue, because parallel queues cannot preserve event ordering for regions. Only the ordering of events for a given partition (or in a given queue of a distributed region) can be preserved.

key
\-\-gateway-event-filter A list of fully-qualified class names of GatewayEventFilters (separated by comma) to be associated with the GatewaySender. This serves as a callback for users to filter out events before dispatching to remote distributed system. For example:
gateway-event-filter=com.user.filters.MyFilter1,com.user.filters.MyFilters2
\-\-gateway-transport-filter The fully-qualified class name of the GatewayTransportFilter to be added to the GatewaySender.

Example Commands:

gfsh>create gateway-sender --remote-distributed-system-id="2" --id="sender2"

Sample Output:

gfsh>create gateway-sender --remote-distributed-system-id="2" --id="sender2"
Member  | Status
server1 | GatewaySender "sender2" created on "server1"

create index

Create an index that can be used when executing queries.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

See Working with Indexes.

Syntax:

create index --name=value --expression=value --region=value 
[--member=value] [--type=value] [--group=value]

Parameters: create index:

Name Description Default
\-\-name Required. Name of the index to create.
‑‑expression Required. Field of the region values that are referenced by the index.
\-\-region Required. Name/Path of the region which corresponds to the "from" clause in a query.
\-\-member Name/Id of the member on which index will be created.
\-\-type Type of the index. Valid values are: range, key and hash. range
\-\-group The index will be created on all the members in this member group.

Example Commands:

create index --name=myKeyIndex --expression=region1.Id --region=region1 --type=key

Sample Output:

gfsh>create index --name=myKeyIdex --expression=region1.Id --region=region1 --type=key
Index successfully created with following details
Name       : myKeyIdex
Expression : region1.Id
RegionPath : /region1
Members which contain the index
1. ubuntu(server1:17682)<v1>:27574

gfsh>create index --name=myIndex2 --expression=exp2 --region=/exampleRegion
Failed to create index "myIndex2" due to following reasons
Index "myIndex2" already exists.  Create failed due to duplicate name.
Occurred on following members
1. ubuntu(server1:17682)<v1>:27574

create lucene index

Create a Lucene index.

See also describe lucene index, destroy lucene index, list lucene indexes and search lucene.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:

create lucene index --name=value --region=value --field=value(,value)*
  [--analyzer=value(,value)*] [--group=value(,value)*]

Parameters, create lucene index:

Name Description Default
\-\-name Required. Name of the index to create.
\-\-region Required. Name/Path of the region which corresponds to the "from" clause in a query.
\-\-field Required. Field of the region values that are referenced by the index. To treat the entire value as a single field, specify __REGION_VALUE_FIELD.
‑‑analyzer Analyzer to extract terms from text. Use DEFAULT to specify the default analyzer.
\-\-group The index will be created on all the members in the specified member groups.

Example Commands:

create lucene index --name=customerIndex --region=/Customer 
   --field=__REGION_VALUE_FIELD

gfsh>create lucene index --name=analyzerIndex --region=/Person 
     --field=name,email,address,revenue 
     --analyzer=DEFAULT,org.apache.lucene.analysis.core.KeywordAnalyzer,
                examples.MyCharacterAnalyzer,DEFAULT

Sample Output:

gfsh>create lucene index --name=testIndex --region=testRegion
    --field=__REGION_VALUE_FIELD
               Member                  | Status
192.168.1.23(server505:17200)<v1>:1025 | Successfully created lucene index

create region

Create a region with given path and configuration.

You must specify either a --type or a --template-region for initial configuration when creating a region. Specifying a --key-constraint and --value-constraint makes object type information available during querying and indexing.

See Region Data Storage and Distribution.

Availability: Online. You must be connected in gfsh to a JMX Manager member to use this command.

Syntax:

 create region --name=value [--type=value] [--template-region=value]
    [--group=value(,value)*] [--skip-if-exists(=value)?]
    [--key-constraint=value] [--value-constraint=value]
    [--enable-statistics=value] [--entry-idle-time-expiration=value]
    [--entry-idle-time-expiration-action=value]
    [--entry-time-to-live-expiration=value]
    [--entry-time-to-live-expiriation-action=value]
    [--region-idle-time-expiration=value]
    [--region-idle-time-expiration-action=value]
    [--region-time-to-live-expiration=value]
    [--region-time-to-live-expiration-action=value] [--disk-store=value]
    [--enable-synchronous-disk=value] [--enable-async-conflation=value]
    [--enable-subscription-conflation=value] [--cache-listener=value(,value)*]
    [--cache-loader=value] [--cache-writer=value]
    [--async-event-queue-id=value(,value)*]
    [--gateway-sender-id=value(,value)*] [--enable-concurrency-checks=value]
    [--enable-cloning=value] [--concurrency-level=value]
    [--colocated-with=value] [--local-max-memory=value]
    [--recovery-delay=value] [--redundant-copies=value]
    [--startup-recovery-delay=value] [--total-max-memory=value]
    [--total-num-buckets=value] [--compressor=value] [--off-heap(=value)]
    [--partition-resolver=value]

Parameters, create region:

Name Description Default
\-\-name Required. Name/Path of the region to be created.
\-\-type Required (if template-region is not specified.) Type of region to create. Options include: PARTITION, PARTITION_REDUNDANT, REPLICATE, LOCAL, etc.

To get a list of of all region type options, add the \-\-type parameter and then select the TAB key to display a full list.

\-\-template-region Required (if type is not specified.) Name/Path of the region whose attributes should be duplicated when creating this region.
\-\-group Group(s) of members on which the region will be created.
\-\-skip-if-exists Skip region creation if the region already exists. If the parameter is specified without a value, the value is set to true. If the parameter is not specified, the value (default) is false. true
\-\-key-constraint Fully qualified class name of the objects allowed as region keys. Ensures that keys for region entries are all of the same class.
\-\-value-constraint Fully qualified class name of the objects allowed as region values. If not specified, then region values can be of any class.
\-\-enable-statistics Whether to gather statistics for the region. Must be true to use expiration on the region.
\-\-entry-idle-time-expiration How long the region's entries can remain in the cache without being accessed. no expiration
\-\-entry-idle-time-expiration-action Action to be taken on an entry that has exceeded the idle expiration. Valid expiration actions include destroy, local-destroy, invalidate (default), local-invalidate.
\-\-entry-time-to-live-expiration How long the region's entries can remain in the cache without being accessed or updated. The default is no expiration of this type. no expiration
\-\-entry-time-to-live-expiration-action Action to be taken on an entry that has exceeded the TTL expiration. Valid expiration actions include destroy, local-destroy, invalidate (default), local-invalidate.
\-\-region-idle-time-expiration How long the region can remain in the cache without being accessed. The default is no expiration of this type. no expiration
\-\-region-idle-time-expiration-action Action to be taken on a region that has exceeded the idle expiration. Valid expiration actions include destroy, local-destroy, invalidate (default), local-invalidate.
\-\-region-time-to-live-expiration How long the region can remain in the cache without being accessed or updated. The default is no expiration of this type. no expiration
\-\-region-time-to-live-expiration-action Action to be taken on a region that has exceeded the TTL expiration. Valid expiration actions include destroy, local-destroy, invalidate (default), local-invalidate.
\-\-disk-store Disk Store to be used by this region. The [list disk-stores](list.html#topic_BC14AD57EA304FB3845766898D01BD04) command can be used to display existing disk stores.
\-\-enable-synchronous-disk Whether writes are done synchronously for regions that persist data to disk.
\-\-enable-async-conflation Whether to allow aggregation of asynchronous TCP/IP messages sent by the producer member of the region. A false value causes all asynchronous messages to be sent individually.
\-\-enable-subscription-conflation Whether the server should conflate its messages to the client. A false value causes all server-client messages to be sent individually.
\-\-cache-listener Fully qualified class name of a plug-in to be instantiated for receiving after-event notification of changes to the region and its entries. Any number of cache listeners can be configured.
\-\-cache-loader Fully qualified class name of a plug-in to be instantiated for receiving notification of cache misses in the region. At most, one cache loader can be defined in each member for the region. For distributed regions, a cache loader may be invoked remotely from other members that have the region defined.
\-\-cache-writer Fully qualified class name of a plug-in to be instantiated for receiving before-event notification of changes to the region and its entries. The plug-in may cancel the event. At most, one cache writer can be defined in each member for the region.
\-\-async-event-queue-id IDs of the Async Event Queues that will be used for write-behind operations.
\-\-gateway-sender-id IDs of the Gateway Senders to which data will be routed.
\-\-enable-concurrency-checks Whether Region Version Vectors are implemented. Region Version Vectors are an extension to the versioning scheme that aid in synchronization of replicated regions.
\-\-enable-cloning Determines how fromDelta applies deltas to the local cache for delta propagation. When true, the updates are applied to a clone of the value and then the clone is saved to the cache. When false, the value is modified in place in the cache.
\-\-concurrency-level Estimate of the maximum number of application threads that will concurrently access a region entry at one time. This attribute does not apply to partitioned regions.
\-\-colocated-with Central Region with which this region should be colocated.
\-\-local-max-memory Maximum amount of memory, in megabytes, to be used by the region in this process. (The default is 90% of available heap.)
\-\-recovery-delay Delay in milliseconds that existing members will wait before satisfying redundancy after another member crashes. The default (value of -1) indicates that redundancy will not be recovered after a a failure.
\-\-redundant-copies Number of extra copies of buckets desired. Extra copies allow for both high availability in the face of VM departure (intended or unintended) and load balancing read operations. (Allowed values: 0, 1, 2 and 3)
\-\-startup-recovery-delay Delay in milliseconds that new members will wait before satisfying redundancy. -1 indicates that adding new members will not trigger redundancy recovery. The default is to recover redundancy immediately when a new member is added.
\-\-total-max-memory Maximum amount of memory, in megabytes, to be used by the region in all processes.
\-\-total-num-buckets Total number of hash buckets to be used by the region in all processes. 113
\-\-compressor Java class name that implements compression for the region. You can write a custom compressor that implements org.apache.geode.compression.Compressor or you can specify the Snappy compressor (org.apache.geode.compression.SnappyCompressor), which is bundled with Geode. See Region Compression. no compression
\-\-off-heap Specifies whether the region values are stored in heap memory or off-heap memory. When true, region values are in off-heap memory. If the parameter is specified without a value, the value of true is used. false
\-\-partition-resolver Specifies the full path to a custom partition resolver. To use the provided default partition resolver, specify org.apache.geode.cache.util.StringPrefixPartitionResolver.

Example Commands:

create region --name=region1 --type=REPLICATE_PERSISTENT \
--cache-writer=org.apache.geode.examples.MyCacheWriter \
--group=Group1 --disk-store=DiskStore1

create region --name=region12 --template-region=/region1

create region --name=region2 --type=REPLICATE \
--cache-listener=org.apache.geode.examples.MyCacheListener1,\
org.apache.geode.examples.MyCacheListener2 \
--group=Group1,Group2

create region --name=region3 --type=PARTITION_PERSISTENT --redundant-copies=2 --total-max-memory=1000 \
--startup-recovery-delay=5 --total-num-buckets=100 --disk-store=DiskStore2 \
--cache-listener=org.apache.geode.examples.MyCacheListener3 \
--group=Group2 

create region --name=region4 --type=REPLICATE_PROXY --cache-listener=org.apache.geode.examples.MyCacheListener1 
--group=Group1,Group2

Sample Output:

gfsh>create region --name=myRegion --type=LOCAL
Member  | Status
server1 | Region "/myRegion" created on "server1"

results matching ""

    No results matching ""