Install/Uninstall NCache Java Client
This feature is only available in NCache Enterprise Edition.
This section describes step-by-step instructions for installing and uninstalling NCache Java Client on UNIX.
In installation, you can make use of the .tar.gz file to install NCache Java Client on your UNIX machine. You can specify some customized parameters such as install directory, a user under which NCache Java Client service will run, network IP to be used by NCache Java Client etc. If you don’t customize any parameters, NCache Java Client is installed according to default values. It is installed in the specified directory and NCache service runs under a default user called “NCache”.
In order to install NCache Java Client on your machine, you need to have “root” privileges.
In order to install NCache Java Client on you UNIX system, please follow these steps:
Log in as root user.
In UNIX terminal, enter the following command in order to navigate to the directory where you have placed the .tar.gz file of NCache Java Client you downloaded from the Alachisoft website.
[root@servername]# cd [NCache_Java_Client_setup_path]
- Extract the .tar.gz file through the following command:
[root@servername]# tar –zxvf NCache.Java.Client.tar.gz
The extracted files can be found in the directory named ncache-enterprise-x.x-javaclient
- Navigate to the directory where .tar.gz has been extracted, through the following command:
[root@servername]# cd ncache-enterprise-javaclient
- Now is the time to run installation. Use the following command (as root):
[root@servername]# ./install –f John –l Smith –e email@example.com -u Jenny –j JAVA_HOME_PATH –i 220.127.116.11
- Please specify JDK/JRE 1.6 or later.
NCache Java Client is now successfully installed on your UNIX machine. After successful installation, you will get the following output message:
Starting NCache service jvmargument: -Xmx816000m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmx remote.port=1501 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.man agement.jmxremote.ssl=false -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000, suspend=n -Djava.library.path=/opt/NCache/lib/resources/sigar/ -server CacheServer.BindToClientServerIP =18.104.22.168 CacheServer.BindToClusterIP=22.214.171.124 CacheManagementServer.Port=8250 CacheServer.Port=9800 Checking service status ... NCache service started.
You can customize your installation through the following flags:
||First name of the user to which NCache Java Client is licensed.|
||Last name of the user to which NCache Java Client is licensed.|
||Email address of the user to which NCache Java Client is licensed.|
||It points to the directory where Java Runtime Environment (JRE) or Java Development Kit (JDK) is installed on your system. If no or invalid path is specified, it will search for the java location itself. Recommended java version is 1.6. It will first look for version 1.6; if it is not found, it will search for any greater version available.|
||IP address to be used by NCache Java Client, if no IP is specified it will use the first network interface card it finds.|
||Location where NCache Java Client will be installed, by default it will be installed on current location.|
||You receive this via email from Alachisoft when you downloaded NCache Java Client. If not, then visit http://www.alachisoft.com/download.html to register and obtain one. It is mandatory for you to specify this.|
Verify NCache Java Client Installation
After installation you can verify NCache Java Client installation by any of the following ways:
- In UNIX terminal, enter the following command:
This command lists system services. If the NCache Java Client service
is also listed as follows you can be sure that NCache Java Client has been
NCached 0:off 1:off 2:on 3:on 4:on 5:on 6:off
NCHOME to the location where you have installed NCache Java Client through
Then run the following commands:
[root@servername]cd //opt/ncache/bin [root@servername]./NCached status
If your installation was successful, you should be able to see the following output:
NCache Java Client Server Status: Running CacheServer.BindToClientServerIP =126.96.36.199 CacheServer.BindToClusterIP=188.8.131.52 CacheManagementServer.Port=8250 CacheServer.Port=9800
- Navigate to the
configfolder of NCache Java Client. The server.properties file is placed in this folder. server.properties file can be found in installation directory. This directory is the one you specified through the
-pflag. In order to verify your connection, please look up for this file through the following command:
[root@servername]# cd ~/%NCHOME%/config
After locating server.properties, open it in editor. In case of successful installation, you should be able to see your system IP used by property values as follows:
What has been installed?
NCache Java Client is installed in the directory you mentioned at the time of
installation. In custom .tar.gz installation, this directory will either be the
default directory that is
/opt/ncache/ or it will be the directory you
mentioned at the time of installation using –p parameter.
After installation, you will find the following files in this directory:
- Configuration Files: The following configuration files are provided in order to configure and run NCache Java Client:
Libraries: Various .jar assembly files are provided for you to refer to when developing with NCache Java Client. These libraries are also used by NCache service.
Bin: The following NCache Java Client Tools are provided:
Integrations: Some integrations (hibernate, hibernate 3.5) are provided along with the installation. These are used while integrating NCache as second level cache in many provider-based frameworks.
Logs: This folder will contain client and server related logs.
In order to uninstall NCache Java Client from your machine, you need to be logged in as root user or as an authorized user like “NCache Java Client”.
In order to uninstall NCache Java Client from your UNIX machine, please follow these steps:
- Open the terminal and navigate to the directory where you extracted NCache Java Client. Use the command:
[root@servername]# cd ~/NCache-enterprise-javaclient
- In order to uninstall NCache Java Client, enter the following command:
[root@servername]# ./uninstall -p /opt/%NCHOME%
NCache Java Client is successfully uninstalled from your system. You see the following output:
Stopping Service ... Removing Service ... NCache Java Client uninstalled. User ‘NCache’ created at install time is not deleted. Please use userdel command to remove the user. For support please free to contact firstname.lastname@example.org For complete documentation visit the website <http://www.alachisoft.com/resources/docs/index.html>
The java.lang.NoClassDefFoundError : com/alachisoft/ncache/licensing/LicenseManager message occurs when the required jar files are not available at their appropriate location. NCache Client API for Java is shipped with the following jar files:
NCClient.jar: The Main NCache Client API file.
NCActivate.jar: The file is responsible for the Activation of NCache. The user may extend his/her evaluation period by running this file. This file can be run by executing the "activate.bat" file.
installer.jar: This file is only for Unix environment and is responsible for NCache client installation on Unix machines.
NCRuntime.jar: The file is responsible for Read-Through/Write-Through caching and Cache Startup operations.
NCSerialization.jar: This file is responsible for dynamic Compact Serialization and object sharing operations.
NCacheSessionProvider.jar: This file is responsible for providing JSP session caching support.
NCUtil.jar: This file contains the methods required by NCache Web Manager and Service.
swing-layout-1.0.4.jar: This file is providing Java library for GUI.
javassist.jar: This file is the 3rd party library responsible for runtime code generation.
Copy all three jar files at the same location and mention location in