DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Install Couchbase on Windows Azure

Install Couchbase on Windows Azure

Jim O' Neil user avatar by
Jim O' Neil
·
Jun. 25, 12 · Interview
Like (0)
Save
Tweet
Share
3.94K Views

Join the DZone community and get the full member experience.

Join For Free

For those of you who have been following my series of articles about setting up Couchbase on Windows Azure, I’m now at the most ‘Couchbase-specific’ portion of the process. So far, I’ve set up a virtual network and created a cluster of of three virtual machine instances that have been prepped to support Couchbase, and the next step is to install the software on those VMs. If you’re not working with Couchbase specifically, this post is ok to skip!

Installing Couchbase on the VM Instance

Recall from a previous post that when creating the Couchbase20-rel4 image for the Virtual Machine Gallery, I had downloaded and saved the Couchbase installation file to the C:\ drive. I specifically did not run in on the base virtual machine image because Couchbase’s installer records the IP address of the current machine as part of the setup process. Executing it on the base virtual machine image would have created an installation that would not work when individual images (with completely different addresses) were created from it. That could be remedied via some Couchbase reconfiguration scripts, but in this particular case, it was just easier to run the installer three times, once on each virtual machine.

Couchbase installation program on VM instance

Running the setup spawns a familiar sequence of setup screens. The release I installed prompts for an installation directory (which I left at the default), and the rest of the process simply involves clicking through the the various informational screens until the installation has completed. Couchbase installation progress

After clicking Finish on the final dialog, the Couchbase web administration console appears.

Couchbase administration site

Via a few clicks on the web administration console, you can set up the server or add a server to an existing cluster; however, since this VM image is locked down, I’d need to turn off IE’s Enhanced Security Configuration (ESC) to use the browser-based interface to install the product.  And I’d need to do that on each of the three virtual machines in the cluster.

As an alternative, I can use the Couchbase command-line interface, with the added bonus that a script can be run once on a single VM yet configure the entire cluster.

Configuring the Cluster

To initialize the cluster, I created a PowerShell script on my local machine and just cut-and-pasted that script into a new Notepad file on one of the VMs.

# replace with the IP addresses of the VMS
# after Couchbase has been installed on each VM
$server1='192.168.0.36:8091'
$server2='192.168.0.37:8091'
$server3='192.168.0.38:8091'

# set desired cluster user id and password
$uid="Administrator"
$pwd="TapMap"

# set path to couchbase-cli
$env:path = $env:path + ";C:\program files\Couchbase\Server\bin\"

# create the cluster with RAM size 512MB
couchbase-cli cluster-init -c $server1 `
    --cluster-init-username=$uid `
    --cluster-init-password=$pwd `
    --cluster-init-ramsize=512


# create the bucket 'beernique' with size 256MB
couchbase-cli bucket-create -c $server1 `
    --bucket=beernique `
    --bucket-password=b33rs `
    --bucket-type=couchbase `
    --bucket-port=11211 `
    --bucket-ramsize=256 `
    --bucket-replica=2 `
    -u $uid `
    -p $pwd


# add second server to cluster
couchbase-cli server-add -c $server1 `
    --server-add=$server2 `
    -u $uid `
    -p $pwd


# add final server to cluster (and rebalance)
couchbase-cli rebalance -c $server1 `
    --server-add=$server3 `
    -u $uid `
    -p $pwd

The script includes a few items (shaded above) that needed to be initialized for my specific environment:

  • $server1, $server2, and $server3 are set to the subnet IPs of each of the VMs in my Couchbase cluster
  • $uid is the user id for the Couchbase cluster that will be created
  • $pwd is the password associated with $uid
  • $env:path includes the location of the couchbase-cli utility, which was installed when running the Couchbase installer on each VM.

The remainder of the script, which doesn't require modification, creates the cluster and initializes a Couchbase bucket to store the data associated with the sample TapMap application. couchbase-cli has a number of subcommands that can be exercised to initialize the Couchbase cluster, each requiring the Couchbase cluster credentials:

  • cluster-init sets up the cluster using the address of $server1 that is provided at the top of the script and gives each member of the cluster a RAM configuration of 512MB.
  • bucket-create creates a new Couchbase bucket called beernique with a password of b33rs. The bucket will occupy up to half of the Couchbase server RAM allocation on each machine. Additionally, data in the bucket will be replicated to two other servers in the cluster for high availability.
  • server-add adds another server to the cluster that was just created.
  • rebalance does the same thing as server-add but also rebalances the cluster, so it’s called to add just the final server into the cluster.

I can run the script in any of the three Couchbase VMs, since they are on the same subnet and have visibility to each other via their internal IP addresses. PowerShell is already part of the server VM image, so I simply save the script in a file on the VM and use the PowerShell console to execute it. Note that to do so, I need to set the execution policy to unrestricted, since my temporary script was not signed. After running the script, I do reset the execution policy to the more stringent value of restricted.

PowerShell script to configure server

And that’s it! When the script completes, the cluster is set up, and I can view its configuration from any machine in that cluster via the URL http://localhost:8091.

Couchbase running cluster

There’s no data in Couchbase yet, but I’ll get to that next as I discuss how to install the TapMap application and trigger populating the database with beer and brewery data.

 

 

cluster Virtual Machine azure

Published at DZone with permission of Jim O' Neil, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 10 Most Popular Frameworks for Building RESTful APIs
  • ClickHouse: A Blazingly Fast DBMS With Full SQL Join Support
  • Scaling Your Testing Efforts With Cloud-Based Testing Tools
  • How To Handle Secrets in Docker

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: