Basic GemFire SHell Commands

debug
  • availability: online or offline
  • arguments:
    debug --state=on_or_off
  • examples:
    debug --state=on
    debug --state=OFF
echo
  • availability: online or offline
  • arguments:
    echo [--string=value_to_be_echoed]
  • examples:
    echo --string="Hello, this is ${SYS_USER}"
    echo --string=${APP_FETCH_SIZE}
encrypt password
  • availability: online or offline
  • arguments:
    encrypt password --password=password_to_encrypt
  • examples:
    encrypt password --password=my_password
exit (or quit)
  • availability: online or offline
  • arguments: none
  • examples:
    exit
    quit
help
  • availability: online or offline
  • arguments:
    help [command]
  • examples:
    help connect
    help start
    help start server
hint
  • availability: online or offline
  • arguments:
    hint [topic]
  • examples:
    hint
    hint Data
    hint Function Execution
    
history
  • availability: online or offline
  • arguments:
    history [--file=history_filename_to_write]
  • examples:
    history
    history --file=my_gfsh_history.txt
    history --file=./mycommands.gfsh
run
  • availability: online or offline
    Note: Commands specified in the file may have their own online or offline connection requirements.
  • arguments:
    run --file=value [--quiet(=true_or_false)?] 
    [--continue-on-error(=true_or_false)?]
  • examples:
    run --file=gfsh_script.txt
    run --file=gfsh_script.txt --quiet --continue-on-error
set variable
  • availability: online or offline
  • arguments:
    set variable --name=variable_name --value=variable_value
  • examples:
    set variable --name=APP_FETCH_SIZE --value=1200
    set variable --name=MY_VARIABLE --value=GemFire
sleep
  • availability: online or offline
  • arguments:
    sleep [--time=value in seconds]
  • examples:
    sleep
    sleep --time=60
version
  • availability: online or offline
  • arguments:
    version [--full]
  • examples:
    version
    version --full

Configuration Commands

alter runtime
  • availability: online
  • arguments:
    alter runtime [--member=name_or_id_of_member] [--group=member_group_name] 
    [--archive-disk-space-limit=limit_in_megabytes] 
    [--archive-file-size-limit=limit_in_megabytes] 
    [--log-disk-space-limit=limit_in_megabytes] 
    [--log-file-size-limit=limit_in_megabytes] 
    [--log-level=none_error_info_config_fine_finer_or_finest] 
    [--statistic-archive-file=filename_where_statistics_are_written] 
    [--statistic-sample-rate=rate_in_milliseconds] 
    [--enable-statistics=true_or_false]
  • examples:
    alter runtime --member=member1 --enable-statistics=false
describe config
  • availability: online
  • arguments:
    describe config --member=membername_or_id [--hide-defaults(=true_or_false)?]
  • examples:
    describe config --member=member1
    describe config --member=member1 --hide-defaults
    
export config
  • availability: online
  • arguments:
    export config [--member=membername_or_id(,additional_membername_or_id)*] 
    [--group=groupname(,additional_groupname)*] [--dir=target_dir_name]
  • examples:
    export config --member=member1

Data Commands

export data
  • availability: online
  • arguments:
    export data --region=region_to_export --file=target_file_name.gfd --member=membername_or_id_hosting_region
  • examples:
    export data --region=MyRegion --file=MyRegionExport.gfd --member=server1
get
  • availability: online
  • arguments:
    get --key=value --region=region_name [--key-class=object_type] [--value-class=object_type]
  • examples:
    get --key='id'
import data
  • availability: online
  • arguments:
    import data --region=region_name --file=file_to_import.gfd --member=membername
  • examples:
    import data --region=DevRegion --file=MyRegionExport.gfd --member=server2
locate entry
  • availability: online
  • arguments:
    locate entry --key=value --region=value [--key-class=value] 
    [--value-class=value] [--recursive=value]
  • examples:
    locate entry --key='id'
put
  • availability: online
  • arguments:
    put --key=value --value=value [--region=value] 
    [--key-class=value] [--value-class=value] [--skip-if-exists=value]
  • examples:
    put --key='id' --value='123'
query
Note: This command should not be executed from gfsh if the objects being queried contain cyclic references.
  • availability: online
  • arguments:
    query --query=select_statement [--step-name=step_name] [--interactive=true_or_false]
  • examples:
    query --query="SELECT * FROM /exampleRegion WHERE id < 10"

Deployment Commands

deploy
  • availability: online
  • arguments:
    deploy [--group=target_group_name(,target_group_name)*] [--jar=jar_filename] [--dir=jar_directory]
  • examples:
    deploy --jar=MyApplication.jar
    deploy --dir=ApplicationDir
list deployed
  • availability: online
  • arguments:
    list deployed [--group=member_groupname(,member_groupname)*]
  • examples:
    list deployed
    list deployed --group=MemberGroup1
undeploy
  • availability: online
  • arguments:
    undeploy [--group=target_member_groupname(,target_member_groupname)*] [--jar=jar_filename(,jar_filename)*]
  • examples:
    undeploy
    undeploy --jar=MyApplication.jar

Disk Store Commands

alter disk-store
  • availability: online
  • arguments:
    alter disk-store --name=diskstore_name --region=region_name --disk-dirs=diskstore_directory(,diskstore_directory)* 
    [--lru-algorthm=none_or_lru-entry-count_or_lru-heap-percentage_or_lru-memory-size] [--lru-action=value] [--lru-limit=none_or_overflow-to-disk_or_local-destroy] 
    [--concurrency-level=maximum_number_of_threads] [--initial-capacity=number_of_entries] 
    [--load-factor=floating_point_between_0_and_1] [--enable-statistics=true_or_false] 
    [--remove(=true_or_false)?]
  • examples:
    alter disk-store --name=Disk1 --region=MyRegion --disk-dirs=/disks/disk1
backup disk-store
  • availability: online
  • arguments:
    backup disk-store --dir=disk_store_directory [--baseline-dir=incremental_backup_base_dir]
  • examples:
    backup disk-store --dir=/disks/disk_backup1 
    --baseline-dir=/disks/disk_backup0/2012-09-10-15-10-12
compact disk-store
  • availability: online
  • arguments:
    compact disk-store --name=disk_store_name [--group=membergroup_name(,membergroup_name)*]
  • examples:
    compact disk-store --name=Disk1
    compact disk-store --name=Disk1 --group=MemberGroup1
compact offline-disk-store
  • availability: online or offline
  • arguments:
    compact offline-disk-store --name=disk_store_name --disk-dirs=disk_store_dir(,disk_store_dir)* 
    [--max-oplog-size=max_size_in_MB] [--J=JVM_args(,JVM_args)*]
  • examples:
    compact offline-disk-store --name=Disk1 --disk-dirs=/disks/Disk1
describe disk-store
  • availability: online
  • arguments:
    describe disk-store --member=member_name --name=disk_store_name
  • examples:
    describe disk-store --member=server1 --name=Disk1
describe offline-disk-store
  • availability: online or offline
  • arguments:
    describe offline-disk-store --name=disk_store_name --disk-dirs=disk_store_dir(,disk_store_dir)* 
    [--region=region_name]
  • examples:
    describe offline-disk-store --name=Disk1
list disk-stores
  • availability: online
  • arguments: none
  • examples:
    list disk-stores
revoke missing-disk-store
  • availability: online
  • arguments:
    revoke missing-disk-store --id=disk_store_guid
  • examples:
    revoke missing-disk-store --id=--id=60399215-532b-406f-b81f-9b5bd8d1b55a
show missing-disk-store
  • availability: online
  • arguments: none
  • examples:
    show missing-disk-stores
upgrade offline-disk-store
  • availability: offline
  • arguments:
    upgrade offline-disk-store --name=disk_store_name --disk-dirs=disk_store_dir(,disk_store_dir)* 
    [--max-oplog-size=max_size_in_MB] [--J=JVM_args(,JVM_args)*]
  • examples:
    upgrade offline-disk-store --name=Disk1 
    --disk-dirs=/disks/Disk1,/disks/Disk2
validate offline-disk-store
  • availability: online or offline
  • arguments:
    validate offline-disk-store --name=disk_store_name --disk-dirs=disk_store_dir(,disk_store_dir)*
  • examples:
    validate offline-disk-store --name=Disk1 
    --disk-dirs=/disks/Disk1,/disks/Disk2

Durable CQ and Client Commands

list durable-cqs
  • availability: online
  • arguments:
    list durable-cqs --durable-client-id=durable_client_id [--member=member_name] [--group=membergroup_name]
  • examples:
    list durable-cqs --durable-client-id=client1
close durable-cq
  • availability: online
  • arguments:
    close durable-cqs --durable-client-id=durable_client_id --durable-cq-name=durable_cq_name [--member=member_name] [--group=membergroup_name]
  • examples:
    close durable-cqs --durable-client-id=client1 --durable-cq-name=cq1
close durable-client
  • availability: online
  • arguments:
    close durable-client --durable-client-id=durable_client_id [--member=member_name ] [--group=membergroup_name]
  • examples:
    close durable-client --durable-client-id=client1
show subscription-queue-size
  • availability: online
  • arguments:
    show subscription-queue-size --durable-client-Id=durable_client_id [--durable-cq-name=durable_cq_name]
    [--member=member_name ] [--group=membergroup_name]
  • examples:
    show subscription-queue-size --durable-client-Id=client1 --durable-cq-name=cq1

Function Execution Commands

destroy function
  • availability: online
  • arguments:
    destroy function --id=function_id [--group=membergroup_name] [--member=member_name_or_id]
  • examples:
    destroy function --id=Function1
execute function
  • availability: online
  • arguments:
    execute function --id=function_id [--group=membergroup_name] [--member=member_name_or_id] 
    [--region=region_name] [--arguments=function_arguments(,function_arguments)*] [--result-collector=class_name_of_result_collector] 
    [--filter=list_of_keys]
  • examples:
    execute function --id=Function1
list functions
  • availability: online
  • arguments:
    list functions [--matches=java_pattern_to_match] [--group=membergroup_name(,membergroup_name)*] 
    [--member=member_name_or_id(,member_name_or_id)*]
  • examples:
    list functions

Gateway (WAN) Commands

list gateways
  • availability: online
  • arguments:
    list gateways [--group=membergroup_name(,membergroup_name)*]
  • examples:
    list gateways
    list gateways --group=MemberGroup1
pause gateway-sender
  • availability: online
  • arguments:
    pause gateway-sender --id=gateway_sender_id [--group=membergroup_name(,membergroup_name)*] [--member=member_name]
  • examples:
    pause gateway-sender --id=sender1
resume gateway-sender
  • availability: online
  • arguments:
    resume gateway-sender --id=gateway_sender_id [--group=membergroup_name(,membergroup_name)*] [--member=member_name]
  • examples:
    resume gateway-sender --id=sender1
start gateway-receiver
  • availability: online
  • arguments:
    start gateway-receiver [--group=membergroup_name(,membergroup_name)*] [--member=member_name]
  • examples:
    start gateway-receiver
start gateway-sender
  • availability: online
  • arguments:
    start gateway-sender --id=gateway_sender_id [--group=membergroup_name(,membergroup_name)*] [--member=member_name]
  • examples:
    start gateway-sender --id=sender1
status gateway-receiver
  • availability: online
  • arguments:
    status gateway-receiver [--group=membergroup_name(,membergroup_name)*] [--member=member_name]
  • examples:
    status gateway-receiver
status gateway-sender
  • availability: online
  • arguments:
    status gateway-sender --id=gateway_sender_id [--group=membergroup_name(,membergroup_name)*] [--member=member_name]
  • examples:
    status gateway-sender --id=Gateway1
stop gateway-receiver
  • availability: online
  • arguments:
    stop gateway-receiver [--group=membergroup_name(,membergroup_name)*] [--member=member_name]
  • examples:
    stop gateway-receiver
stop gateway-sender
  • availability: online
  • arguments:
    stop gateway-sender --id=gateway_sender_id [--group=membergroup_name(,membergroup_name)*] [--member=member_name]
  • examples:
    stop gateway-sender --id=Gateway1

GemFire Monitoring Commands

describe member
  • availability: online
  • arguments:
    describe member --name=member_name_or_id
  • examples:
    describe member --name=member1
export logs
  • availability: online
  • arguments:
    export logs --dir=target_directory_name [--group=membergroup_name(,membergroup_name)*] [--member=member_name_or_id] 
    [--log-level=none_or_error_or_info_or_config_or_fine_or_finer and finest] [--only-log-level=true_or_false] [--merge-log=true_or_false] 
    [--start-time=yyyy/MM/dd/HH/mm/ss/SSS/z_OR_yyyy/MM/dd] [--end-time=yyyy/MM/dd/HH/mm/ss/SSS/z_OR_yyyy/MM/dd]
  • examples:
    export logs --dir=LogDir
export stack-traces
  • availability: online
  • arguments:
    export stack-traces --file=name_of_export_file [--member=member_name_or_id] [--group=membergroup_name]
  • examples:
    export stack-traces --file=stack.txt
gc
  • availability: online
  • arguments:
    gc [--group=membergroup_name(,membergroup_name)*] [--member=member_name_or_id]
  • examples:
    gc
    gc --member=server1
    gc --group=MemberGroup1
list members
  • availability: online
  • arguments:
    list members [--group=membergroup_name]
  • examples:
    list members
    list members --group=MemberGroup1
netstat
  • availability: online
  • arguments:
    netstat [--member=member_name_or_id(,member_name_or_id)*] [--group=membergroup_name] [--file=text_file_for_output] 
    [--with-lsof(=true_or_false_linux/unix_hosts_only)?]
  • examples:
    netstat
show dead-locks
  • availability: online
  • arguments:
    show dead-locks --file=text_file_to_write_deadlocks
  • examples:
    show dead-locks --file=deadlock1.txt
show log
  • availability: online
  • arguments:
    show log --member=member_name_or_id [--lines=number_of_lines]
  • examples:
    show log --member=server1
    show log --member=server1 --lines=100
show metrics
  • availability: online
  • arguments:
    show metrics [--member=member_name_or_id] [--region=region_name] [--file=output_file_name] 
    [--port=port_number_of_member] [--categories=metric_type(,metric_type)*]
  • examples:
    show metrics
    show metrics --region=MyRegion
    show metrics --categories=cluster,cache
shutdown
  • availability: online
  • arguments:
    shutdown [--time-out=time_in_seconds]
  • examples:
    shutdown
    shutdown --time-out=60
start jconsole
  • availability: online or offline
  • arguments:
    start jconsole [--interval=refresh_interval_in_seconds] [--notile(=true_or_false)?] [--pluginpath=dir_or_jar_for_jconsole-plugins] 
    [--version(=true_or_false)?] [--J=arg_passed_to_jvm(,arg_passed_to_jvm)*]
  • examples:
    start jconsole --interval=15 --notile
start jvisualvm
  • availability: online or offline
  • arguments:
    start jvisualvm [--J=arg_passed_to_jvm(,arg_passed_to_jvm)*]
  • examples:
    start jvisualvm
start pulse
  • availability: online or offline
  • arguments:
    start pulse [--url=pulse_http_url]
  • examples:
    start pulse
    start pulse --url=http://gemfire.company.com:8080/pulse
start vsd
  • availability: online or offline
  • arguments:
    start vsd [--file=stats_file_to_open(,stats_file_to_open)*]
  • examples:
    start vsd
    start vsd --file=MyStatsFile.gfs

Index Commands

create index
  • availability: online
  • arguments:
    create index --name=index_name --expression=region_field_to_index --region=region_name
    [--member=member_name] [--type=range_or_key_or_hash] [--group=membergroup_name]
  • examples:
    create index --name=MyIndex --expression=id --region=/exampleRegion --type=key
destroy index
  • availability: online
  • arguments:
    destroy index [--name=index_name] [--region=region_name] 
    [--member=member_name] [--group=membergroup_name]
  • examples:
    destroy index 
    destroy index --name=MyIndex
list indexes
  • availability: online
  • arguments:
    list indexes [--with-stats(=true_or_false)?]
  • examples:
    list indexes
    list indexes --with-stats

JMX Connection Commands

connect
  • availability: offline
  • arguments:
    connect [--locator=locator_hostname[port]] 
    [--jmx-manager=jmx_manager_hostname[port]] 
    [--user=username] [--password=password] 
    [--key-store=keystore_filename] [--key-store-password=keystore_password] 
    [--trust-store=cert_truststore_filename] [--trust-store-password=cert_truststore_password] 
    [--ciphers=SSL_TSL_ciphers] [--protocols=SSL_TSL_protocol_versions]
    [--security-properties-file=path_to_gfsecurity.properties_file
  • examples:
    connect
    connect --locator=MyHost
    connect --locator=MyHost[10334]
describe connection
  • availability: online or offline
    Note: Indicates that there is no connection ("Not connected") if executed offline.
  • arguments: none
  • examples:
    describe connection
disconnect
  • availability: online
  • arguments: none
  • examples:
    disconnect

Locator Commands

start locator
  • availability: online or offline
  • arguments:
    start locator --name=locator_name [--dir=locator_working_directory] [--bind-address=ip_address] 
    [--force(=true_or_false)?] [--hostname-for-clients=hostname_or_ipaddress_for_clients] [--port=locator_port] 
    [--properties-file=path_to_gemfire_properties_file] [--security-properties-file=path_to_gfsecurity_properties_file]
    [--initial-heap=init_heap_size_formatted_same_as_-J-Xms_arg] [--max-heap=max_heap_size_formatted_same_as_-J-Xmx_arg] 
    [--J=arg_passed_to_jvm(,arg_passed_to_jvm)*]
  • examples:
    start locator --name=locator1

status locator

  • availability: online or offline
  • arguments:
    status locator [--name=locator_name] [--host=ip_address_or_hostname] [--port=locator_port] 
    [--pid=locator_pid] [--dir=locator_working_directory]
  • examples:
    stop locator
    stop locator --name=locator1
    stop locator --pid=1032
stop locator
  • availability: online or offline
  • arguments:
    stop locator [--name=locator_name] [--pid=locator_pid] [--dir=locator_working_directory]
  • examples:
    stop locator
    stop locator --name=locator1
    stop locator --pid=1032

Region Commands

create region
  • availability: online
  • arguments:
    create region --name=region_name 
    [--type=region_type] [--template-region=name_or_path_to_region_to_duplicate] [--group=membergroup_name(,membergroup_name)*] 
    [--skip-if-exists=true_or_false] [--key-constraint=fully_qualified_class_for_region_key_objects] 
    [--value-constraint=fully_qualified_class_for_entry_value_objects] [--enable-statistics=true_or_false] 
    [--entry-idle-time-expiration=time_in_seconds] [--entry-idle-time-expiration-action=destroy_or_local-destroy_or_invalidate_or_local-invalidate] 
    [--entry-time-to-live-expiration=time_in_seconds] [--entry-time-to-live-expiration-action=destroy_or_local-destroy_or_invalidate_or_local-invalidate] 
    [--region-idle-time-expiration=time_in_seconds] [--region-idle-time-expiration-action=destroy_or_local-destroy_or_invalidate_or_local-invalidate] 
    [--region-time-to-live-expiration=time_in_seconds] [--region-time-to-live-expiration-action=destroy_or_local-destroy_or_invalidate_or_local-invalidate] 
    [--disk-store=disk_store_id] [--enable-synchronous-disk=true_or_false] 
    [--enable-async-conflation=true_or_false] [--enable-subscription-conflation=true_or_false] 
    [--cache-listener=fully_qualified_class_for_cache_listener(,another_cache_listener)*] [--cache-loader=fully_qualified_class_for_cache_loader] 
    [--cache-writer=fully_qualified_class_for_cache_writer] [--async-event-queue-id=queue_id(,queue_id)*] 
    [--gateway-sender-id=queue_id(,queue_id)*] [--enable-concurrency-checks=true_or_false] 
    [--enable-cloning=true_or_false] [--concurrency-level=max_number_of_application_threads] 
    [--colocated-with=region_name_to_colocate_with] [--local-max-memory=max_memory_in_MB_for_current_process] 
    [--recovery-delay=delay_in_milliseconds] [--redundant-copies=0_or_1_or_2_or_3] 
    [--startup-recovery-delay=delay_in_milliseconds_for_new_members] 
    [--total-max-memory=max_memory_in_MB_for_all_processes] [--total-num-buckets=total_number_of_buckets_for_all_processes]
  • examples:
    create region --name=MyRegion --type=PARTITION
describe region
  • availability: online
  • arguments:
    describe region --name=region_name
  • examples:
    describe region --name=MyRegion
destroy region
  • availability: online
  • arguments:
    destroy region --name=region_name
  • examples:
    destroy region --name=MyRegion
list regions
  • availability: online
  • arguments:
    list regions [--group=membergroup_name] [--member=member_name_or_id]
  • examples:
    list regions
    list regions --group=MemberGroup1
    list regions --member=server1
rebalance
  • availability: online
  • arguments:
    rebalance [--include-region=partition_region_path_or_name(,partition_region_path_or_name)*] 
    [--exclude-region=partition_region_path_or_name(,partition_region_path_or_name)*] [--time-out=time_to_wait_in_seconds] 
    [--simulate(=true_or_false)?]
  • examples:
    rebalance
    rebalance --simulate

Server Commands

start server
  • availability: online or offline
  • arguments:
    start server --name=server_name [--assign-buckets(=true_or_false)?] 
    [--cache-xml-file=cache_xml_filename_or_path] [--classpath=location_of_user_classes] [--disable-default-server(=true_or_false)?] 
    [--enable-time-statistics(=true_or_false)?] [--force(=true_or_false)?] 
    [--properties-file=path_to_gemfire.properties_file] [--security-properties-file=path_to_gfsecurity_properties_file]
    [--group=membergroup_name][--license-application-cache=acn_license_serial_number] [--license-data-management=dmn_license_serial_number] 
    [--locators=locator_hostname[port]] [--log-level=finest_or_finer_or_fine_or_config_or_info_or_warning_or_severe_or_none] 
    [--mcast-address=mcast_ip_address] [--mcast-port=mcast_port_or_0_to_disable_mcast] 
    [--memcached-port=port_number_of_gemcached_server] [--memcached-protocol=ascii_or_binary]
    [--rebalance(=true_or_false)?] [--server-bind-address=ip_address] 
    [--server-port=cache_server_port_for_client_connections] [--statistic-archive-file=file_to_write_statistic_samples] 
    [--dir=server_working_directory] 
    [--initial-heap=init_heap_size_formatted_same_as_-J-Xms_arg] [--max-heap=max_heap_size_formatted_same_as_-J-Xmx_arg] 
    [--J=arg_passed_to_jvm(,arg_passed_to_jvm)*]
  • examples:
    start server --name=server1
status server
  • availability: online or offline
  • arguments:
    status server [--name=server_name] [--pid=server_pid] [--dir=server_working_directory]
  • examples:
    status server
    status server --name=server1
stop server
  • availability: online or offline
  • arguments:
     stop server [--name=server_name] [--pid=server_pid] [--dir=server_working_directory]
  • examples:
    stop server --name=server1