Table of Contents
Now that you have installed Couchbase and have probably created a
cluster of Couchbase servers, it is time to install the client
libraries, couchbase-client and
spymemcached, and start storing data into the
clusters.
Here's a quick outline of what you'll learn in this chapter:
Download the Java Couchbase Client Libraries, couchbase-client and spymemcached.
Create an Eclipse or NetBeans project and set up the Couchbase Client Libraries as referenced libraries. You'll need to include these libraries at compile time, which should propagate to run time.
Write a simple program to demonstrate connecting to Couchbase and saving some data.
Explore some of the API methods that will take you further than the simple program.
This section assumes you have downloaded and set up a compatible version of Couchbase Server and have at least one instance of Couchbase Server and one data bucket established. If you need to set up these items, you can do with the Couchbase Administrative Console, or Couchbase Command-Line Interface (CLI), or the Couchbase REST-API. For information and instructions, see:
Using the Couchbase Web Console, for information on using the Couchbase Administrative Console,
Couchbase CLI, for the command line interface,
Couchbase REST API, for creating and managing Couchbase resources.
The TCP/IP port allocation on Windows by default includes a restricted number of ports available for client communication. For more information on this issue, including information on how to adjust the configuration and increase the available ports, see MSDN: Avoiding TCP/IP Port Exhaustion.
After you have your Couchbase Server set up and you have installed SDK, you can compile and run the following basic program.