How to install Couchbase on OSX
Getting started with Couchbase on OSX
Couchbase is a NoSQL database that provides a mechanism for storage and retrieval of data.
Because Memcached protocol is supported, existing Memcached system can replace 100%.
Couchbase Server was designed to satisfy include:
- Flexible data model
- Powerful query language
- Scalability
- Performance
- Simple administration
1. Installing the Couchbase Community Server
$ brew install Caskroom/cask/couchbase-server-community
==> brew cask install Caskroom/cask/couchbase-server-community
==> Deleting legacy cache at /Users/tmonplus/Library/Caches/Homebrew/Casks
==> Migrating Caskroom from /opt/homebrew-cask/Caskroom to /usr/local/Caskroom.
==> Creating symlink from /usr/local/Caskroom to /opt/homebrew-cask/Caskroom.
==> Downloading http://packages.couchbase.com/releases/4.1.0/couchbase-server-community_4.1.0-macos_x86_64.zip
######################################################################## 100.0%
==> Verifying checksum for Cask couchbase-server-community
==> Moving App 'Couchbase Server.app' to '/Applications/Couchbase Server.app'.
🍺 couchbase-server-community was successfully installed!
2. Installing the command-line KV client
In order to use command line interface, you need to install libcouchbase.
$ brew install libcouchbase
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (caskroom/cask, homebrew/core).
==> Updated Formulae
purescript
==> Installing dependencies for libcouchbase: openssl, libevent
==> Installing libcouchbase dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2k.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2k.sierra.bottle.tar.gz
==> Using the sandbox
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig
==> Summary
🍺 /usr/local/Cellar/openssl/1.0.2k: 1,696 files, 12MB
==> Installing libcouchbase dependency: libevent
==> Downloading https://homebrew.bintray.com/bottles/libevent-2.1.8.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libevent-2.1.8.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libevent/2.1.8: 847 files, 2.2MB
==> Installing libcouchbase
==> Downloading https://homebrew.bintray.com/bottles/libcouchbase-2.7.3.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libcouchbase-2.7.3.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libcouchbase/2.7.3: 89 files, 2.4MB
3. Setup Couchbase
Running the Couchbase Server.
Accessing http://127.0.0.1:8091/ui/index.html#/ from your web browser, then follow the
steps below.
Creating sample bucket.
Querying Sample Document on Command line.
$ cbc cat airline_10 -U http://localhost/travel-sample
airline_10 CAS=0x14b6698d99820000, Flags=0x2000006. Size=120{"id":10,"type":"airline","name":"40-Mile Air","iata":"Q5","icao":"MLA","callsign":"MILE-AIR","country":"United States"}