Install Cassandra 2.1 on Mac OS X
2015-06-24 15:02
531 查看
http://exponential.io/blog/2015/01/28/install-cassandra-2_1-on-mac-os-x/
Install Cassandra 2.1 on Mac OS X
Akbar S. Ahmed | Jan 28, 2015
Step-by-step instructions
In this post we will install Cassandra 2.1 as a standalone, single node cluster. A single node cluster is an easy way to get started learning Cassandra on your laptop.
These installation steps show how to install a local copy of Cassandra. The benefits of a local copy are that you do not need root or sudo to install Cassandra, updating versions is quick and easy, and you can control how/when to install updates.
Please follow the instructions to Install Oracle Java JDK 7 update 75 on Mac OS X.
In this step we need to create several directories that are used by Cassandra. Each directory is used by the following configuration variable in
data_file_directories: ~/opt/cassandra/data/data
commitlog_directory: ~/opt/cassandra/data/commitlog
saved_caches_directory: ~/opt/cassandra/data/saved_caches
The
via the
Update your PATH to include Cassandra.
Paste the following into your
Source your
We’re going to run Cassandra in the foreground during development. Cassandra will output a lot of information to the terminal when we start the server. However, this information can be useful during development in case there is a problem with the server.
Press
Login to Cassandra with the CQL shell
First, open a new terminal tab by pressing
If everything is working then you should see the following message:
Congratulations. Cassandra 2.1 is now installed on Mac OS X. In a future post we will write some basic CQL commands to insert, update, delete and select data from Cassandra. Subscribe to our newsletter if you would like a weekly update our the latest posts.
Install Cassandra 2.1 on Mac OS X
Akbar S. Ahmed | Jan 28, 2015
Step-by-step instructions
In this post we will install Cassandra 2.1 as a standalone, single node cluster. A single node cluster is an easy way to get started learning Cassandra on your laptop.
These installation steps show how to install a local copy of Cassandra. The benefits of a local copy are that you do not need root or sudo to install Cassandra, updating versions is quick and easy, and you can control how/when to install updates.
Install the Oracle JDK
Please follow the instructions to Install Oracle Java JDK 7 update 75 on Mac OS X.
Install Cassandra
mkdir -p ~/opt/packages && cd $_ curl -O http://psg.mtu.edu/pub/apache/cassandra/2.1.2/apache-cassandra-2.1.2-bin.tar.gz gzip -dc apache-cassandra-2.1.2-bin.tar.gz | tar xf - ln -s ~/opt/packages/apache-cassandra-2.1.2 ~/opt/cassandra
Create data directories for Cassandra
In this step we need to create several directories that are used by Cassandra. Each directory is used by the following configuration variable in conf/cassandra.yaml:
data_file_directories: ~/opt/cassandra/data/data
commitlog_directory: ~/opt/cassandra/data/commitlog
saved_caches_directory: ~/opt/cassandra/data/saved_caches
The
logsdirectory is used by logback which is configured
via the
conf/logback.xmlfile.
mkdir -p ~/opt/cassandra/data/data mkdir -p ~/opt/cassandra/data/commitlog mkdir -p ~/opt/cassandra/data/saved_caches mkdir -p ~/opt/cassandra/logs
Add Cassandra to your PATH
Update your PATH to include Cassandra.open -a TextEdit ~/.bash_profile
Paste the following into your
.bash_profilefile.
# include locally installed Cassandra in PATH if [ -d "$HOME/opt" ]; then PATH="$PATH:$HOME/opt/cassandra/bin" fi
Source your
.bash_profilefile.
source .bash_profile
Start the Cassandra server
We’re going to run Cassandra in the foreground during development. Cassandra will output a lot of information to the terminal when we start the server. However, this information can be useful during development in case there is a problem with the server.cassandra -f
Press
Ctrl + Cwhen you are ready to stop the server.
Getting started with Cassandra
Login to Cassandra with the CQL shell cqlsh.
First, open a new terminal tab by pressing
Command + T.
cqlsh
If everything is working then you should see the following message:
[cqlsh 5.0.1 | Cassandra 2.1.2 | CQL spec 3.2.0 | Native protocol v3] Use HELP for help. cqlsh>
Congratulations. Cassandra 2.1 is now installed on Mac OS X. In a future post we will write some basic CQL commands to insert, update, delete and select data from Cassandra. Subscribe to our newsletter if you would like a weekly update our the latest posts.
相关文章推荐
- adb 命令之appt
- Egret Native项目热更新
- android开发使用fragment commit时的一些坑
- 有序表查找算法(折半,插值,斐波那契)
- 在Tomcat下指定Jsp生成的Java文件路径
- RedirectResult,RedirectToRoute
- Android HAL实例解析
- http状态码 404 200 500
- System.GC.Collect();//垃圾回收,回收没有正常关闭的http连接
- [Javascript] IIFE
- 外企的职位等级制度
- JMeter常用测试元件
- 网络五层模型及相关协议的数据格式
- 【动态规划】【多重背包】[HDU 1059]Dividing
- ios中 继承对象模型的归档实现
- memset,memcpy,strcpy的使用与区别
- memset,memcpy,strcpy的使用与区别
- 【贪心+背包】BZOJ1334 [Baltic2008]Elect
- 【Egret】Native项目热更新
- python模拟登录有验证码的网站记录