Hi all,
as most of you know Infinispan has supported several protocols (HotRod, Memcached, REST, WebSocket) to expose caches to remote clients.
Traditionally these servers have been packaged in Infinispan's distribution with a simple shell script to demonstrate how they should be started (apart from the RESTful server which was packaged as a WAR file).
Since the release of Infinispan 5.3.0.Alpha1 we now have a proper distribution for these servers based around a stripped-down JBoss AS 7.2.0 server. What you get is robust support for all of the collateral services needed by the servers (JDBC Datasources, Transactions, Security, Logging, etc) and a solid platform for exposing your remote caches. Because the Infinispan Server only contains the essential services required by the server endpoints, it is not a full-fledged JEE application server, i.e. it cannot be used to deploy applications or host other services.
To get started with the Infinispan Server, grab yourself the distribution, unpack it and use the provided bin/standalone.sh or standalone.bat depending on your operating system.
The server should come up with HotRod, Memcached and REST endpoints.
The easiest to try out is the REST endpoint using the provided web-based console available on http://localhost:8080. Please also note that by default the REST server is protected using BASIC HTTP authentication.
You should use the provided add-user.sh or add-user.bat scripts, depending
on your platform, to add valid users as follows:
bin/add-user.sh
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): b
Enter the details of the new user to add.
Realm (ApplicationRealm) :
Username : user
Password :
Re-enter Password :
What roles do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]: REST
About to add user 'user' for realm 'ApplicationRealm'
Is this correct yes/no? yes
Added user 'user' to file 'infinispan-server-5.3.0.Alpha1/standalone/configuration/application-users.properties'
Added user 'user' with roles REST to file 'infinispan-server-5.3.0.Alpha1/standalone/configuration/application-roles.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? no
Now open the console by clicking on the [+] in the bottom left corner of your browser window and the following form should appear:
Type the following commands:
PUT /rest/default/a a
Authenticate using the user/password combination you created above and the server should respond with a [200] Success message. In the above command, rest is the name of the endpoint (you can have multiple endpoints pointing to different cache managers or with different security levels), default is the name of the cache and a is the key. The second a is the value you want to associate with the key.
Now retrieve the value using the following command:
GET /rest/default/a
which should respond with a [200] a message. The console supports the various PUT, GET, DELETE, POST, HEAD methods as well as some basic HELP and is capable of recalling history using the up and down arrows.
During the course of the Infinispan 5.3.0 cycle we will be adding documentation and features, so stay tuned and if you have any feedback use the forum or our issue tracker.
Wednesday, 10 April 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment