Test Coherence Installation

Test Coherence Installation

Once installation of oracle coherence server in done using this tutorial next thing you will have to test coherence installation by starting the coherence server. In this demo you will see how to start coherence:

Steps:

  • Set you java path if you are not sure how to set java path please follow this tutorial
  • cd to C:\Oracle\Middleware\Oracle_Home\coherence\bin
  • Open cache-server.cmd file please set COHERENCE_HOME environment variable as below:
@echo off
@
@rem This will start a cache server
@
setlocal

:config
@rem specify the Coherence installation directory
set coherence_home=C:\Oracle\Middleware\Oracle_Home\coherence

@rem specify the JVM heap size
set memory=512m


:start
if not exist "%coherence_home%\lib\coherence.jar" goto instructions

set java_home=%java_home:"=%

if "%java_home%"=="" (set java_exec=java) else (set "java_exec=%java_home%\bin\java")


:launch

if "%1"=="-jmx" (
	set jmxproperties=-Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true
	shift  
)	

set java_opts=-Xms%memory% -Xmx%memory% %jmxproperties%

"%java_exec%" -server -showversion %java_opts% -cp "%coherence_home%\lib\coherence.jar" com.tangosol.net.DefaultCacheServer %1

goto exit

:instructions

echo Usage:
echo   ^<coherence_home^>\bin\cache-server.cmd
goto exit

:exit
endlocal
@echo on
  • Execute below command:

2015-02-11_2221

  • When first time you start the server it cache server looks for existing cluster. When it determinses that there is no cluster server available to join it start with default one and its will be similar to below:
C:\Oracle\Middleware\Oracle_Home\coherence\bin>cache-server.cmd
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) Server VM (build 24.60-b09, mixed mode)

2015-02-11 22:25:25.890/1.030 Oracle Coherence 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded operational configura
tion from "jar:file:/C:/Oracle/Middleware/Oracle_Home/coherence/lib/coherence.jar!/tangosol-coherence.xml"
2015-02-11 22:25:25.944/1.084 Oracle Coherence 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded operational overrides
 from "jar:file:/C:/Oracle/Middleware/Oracle_Home/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
2015-02-11 22:25:25.944/1.084 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration overrid
e "/tangosol-coherence-override.xml" is not specified
2015-02-11 22:25:25.946/1.086 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration overrid
e "cache-factory-config.xml" is not specified
2015-02-11 22:25:25.947/1.087 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration overrid
e "cache-factory-builder-config.xml" is not specified
2015-02-11 22:25:25.947/1.087 Oracle Coherence 12.1.3.0.0 <D5> (thread=main, member=n/a): Optional configuration overrid
e "/custom-mbeans.xml" is not specified

Oracle Coherence Version 12.1.3.0.0 Build 52031
 Grid Edition: Development mode
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

2015-02-11 22:25:26.178/1.318 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded cache configuratio
n from "jar:file:/C:/Oracle/Middleware/Oracle_Home/coherence/lib/coherence.jar!/coherence-cache-config.xml"
2015-02-11 22:25:26.517/1.657 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=n/a): Loaded cache configuratio
n from "jar:file:/C:/Oracle/Middleware/Oracle_Home/coherence/lib/coherence.jar!/internal-txn-cache-config.xml"
2015-02-11 22:25:27.072/2.213 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=n/a): Created cache factory com
.tangosol.net.ExtensibleConfigurableCacheFactory
2015-02-11 22:25:32.519/7.659 Oracle Coherence GE 12.1.3.0.0 <D4> (thread=main, member=n/a): TCMP bound to /192.168.18.1
:8088 using SystemDatagramSocketProvider
2015-02-11 22:25:36.032/11.172 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=Cluster, member=n/a): Created a new cluster
 "cluster:0x76EB" with Member(Id=1, Timestamp=2015-02-11 22:25:32.686, Address=192.168.18.1:8088, MachineId=26301, Locat
ion=site:,machine:JavaHonk,process:24836, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=8, Socket
Count=8)
2015-02-11 22:25:36.035/11.175 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=n/a): Started cluster Name=clu
ster:0x76EB

Group{Address=224.12.1.3, Port=12130, TTL=4}

MasterMemberSet(
  ThisMember=Member(Id=1, Timestamp=2015-02-11 22:25:32.686, Address=192.168.18.1:8088, MachineId=26301, Location=site:,
machine:JavaHonk,process:24836, Role=CoherenceServer)
  OldestMember=Member(Id=1, Timestamp=2015-02-11 22:25:32.686, Address=192.168.18.1:8088, MachineId=26301, Location=site
:,machine:JavaHonk,process:24836, Role=CoherenceServer)
  ActualMemberSet=MemberSet(Size=1
    Member(Id=1, Timestamp=2015-02-11 22:25:32.686, Address=192.168.18.1:8088, MachineId=26301, Location=site:,machine:A
ditya,process:24836, Role=CoherenceServer)
    )
  MemberId|ServiceVersion|ServiceJoined|MemberState
    1|12.1.3|2015-02-11 22:25:32.686|JOINED
  RecycleMillis=1200000
  RecycleSet=MemberSet(Size=0
    )
  )

TcpRing{Connections=[]}
IpMonitor{Addresses=0, Timeout=15s}

2015-02-11 22:25:36.153/11.293 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=Invocation:Management, member=1): Service Man
agement joined the cluster with senior service member 1
2015-02-11 22:25:36.241/11.381 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=1): Loaded Reporter configurat
ion from "jar:file:/C:/Oracle/Middleware/Oracle_Home/coherence/lib/coherence.jar!/reports/report-group.xml"
2015-02-11 22:25:36.538/11.678 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=NameService:TcpAcceptor, member=1): TcpAcce
ptor now listening for connections on 192.168.18.1:8088.3
2015-02-11 22:25:36.860/12.000 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=DistributedCache, member=1): Service Distribu
tedCache joined the cluster with senior service member 1
2015-02-11 22:25:36.922/12.062 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=DistributedCache, member=1): This member has
become the distribution coordinator for MemberSet(Size=1
  Member(Id=1, Timestamp=2015-02-11 22:25:32.686, Address=192.168.18.1:8088, MachineId=26301, Location=site:,machine:Adi
tya,process:24836, Role=CoherenceServer)
  )
2015-02-11 22:25:36.959/12.099 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=ReplicatedCache, member=1): Service Replicate
dCache joined the cluster with senior service member 1
2015-02-11 22:25:36.964/12.104 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=OptimisticCache, member=1): Service Optimisti
cCache joined the cluster with senior service member 1
2015-02-11 22:25:36.967/12.107 Oracle Coherence GE 12.1.3.0.0 <D5> (thread=Invocation:InvocationService, member=1): Serv
ice InvocationService joined the cluster with senior service member 1
2015-02-11 22:25:36.969/12.109 Oracle Coherence GE 12.1.3.0.0 <Info> (thread=main, member=1):
Services
  (
  ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, Version=12.1.3, OldestMemberId=1}
  InvocationService{Name=Management, State=(SERVICE_STARTED), Id=2, Version=12.1.3, OldestMemberId=1}
  PartitionedCache{Name=DistributedCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount
=1, AssignedPartitions=257, BackupPartitions=0, CoordinatorId=1}
  ReplicatedCache{Name=ReplicatedCache, State=(SERVICE_STARTED), Id=4, Version=12.1.3, OldestMemberId=1}
  Optimistic{Name=OptimisticCache, State=(SERVICE_STARTED), Id=5, Version=12.1.3, OldestMemberId=1}
  InvocationService{Name=InvocationService, State=(SERVICE_STARTED), Id=6, Version=12.1.3, OldestMemberId=1}
  )

Started DefaultCacheServer...

As you see above is log of cache server below are some important feature that you will find:

  • Java JDK version number.
  • Information about how configuration files are loaded. The default is to loaded from coherence.jar file
  • Loaded operational configuration from resource “jar:file:/C:/Oracle/Middleware/Oracle_Home/coherence/lib/coherence.jar!/tangosol-coherence.xml”
  • The Coherence release number Oracle Coherence 12.1.3.0.0
  • Coherence edition – Grid Edition: Development mode
  • Multicast address. This address changes with each Coherence version and for version (12.1.3.0.0): Group{Address=224.12.1.3, Port=12130, TTL=4}
  • The Member ID indicates the number of members in your cluster. For this demo the value should be 1 because there no other cluster and installed on window local computer. ThisMember=Member(Id=1, Timestamp=2015-02-11 22:25:32.686, Address=192.168.18.1:8088, MachineId=26301, Location=site:,machine:JavaHonk,process:24836, Role=CoherenceServer)
  • If you are getting Member has an Id greater than one that means that your cache server has joined a pre-existing cluster in your network. For this demo cluster should contain only one member.

That’s it next demo we will cover how to configure Run the Sample Cache Client Application. For more information please visit this oracle official tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *