1. 系统调优

[root@sht-sgmhadoopcm- ~]# echo "vm.max_map_count=131072" >> /etc/sysctl.conf
[root@sht-sgmhadoopcm- ~]# echo "vm.swappiness = 1" >> /etc/sysctl.conf
[root@sht-sgmhadoopcm- ~]# sysctl -p
[root@sht-sgmhadoopcm- ~]# echo "cassandra soft memlock unlimited" >> /etc/security/limits.conf
[root@sht-sgmhadoopcm- ~]# echo "cassandra hard memlock unlimited" >> /etc/security/limits.conf
[root@sht-sgmhadoopcm- ~]# echo "cassandrasoft nofile 65536" >> /etc/security/limits.conf
[root@sht-sgmhadoopcm- ~]# echo "cassandrahard nofile 65536" >> /etc/security/limits.conf
[root@sht-sgmhadoopcm- ~]# echo "cassandrasoft nproc 65536" >> /etc/security/limits.conf
[root@sht-sgmhadoopcm- ~]# echo "cassandrahard nproc 65536" >> /etc/security/limits.conf
[root@sht-sgmhadoopcm- ~]# echo "cassandrasoft as unlimited" >> /etc/security/limits.conf
[root@sht-sgmhadoopcm- ~]# echo "cassandrahard as unlimited" >> /etc/security/limits.conf

2. 安装python2.7.*

[root@sht-sgmhadoopcm- ~]# wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
[root@sht-sgmhadoopcm- ~]# tar -zxf Python-2.7..tgz
[root@sht-sgmhadoopcm- ~]# cd Python-2.7.
[root@sht-sgmhadoopcm- Python-2.7.]# ./configure --prefix=/usr/local/python-2.7.
[root@sht-sgmhadoopcm- Python-2.7.]# make && make install
[root@sht-sgmhadoopcm- Python-2.7.]# /usr/local/python-2.7./bin/python -V
Python 2.7.

3. 安装Java1.8.*

[root@sht-sgmhadoopcm- ~]# wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz
[root@sht-sgmhadoopcm- ~]# tar -zxf jdk-8u171-linux-x64.tar.gz -C /usr/java
[root@sht-sgmhadoopcm- ~]# /usr/java/jdk1..0_171/bin/java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) -Bit Server VM (build 25.171-b11, mixed mode)

4. 创建cassandra用户和组并设置相关环境变量

[root@sht-sgmhadoopcm- ~]# groupadd -r dba -g
[root@sht-sgmhadoopcm- ~]# useradd -r -u -g dba cassandra -d /home/cassandra
[root@sht-sgmhadoopcm- ~]# su - cassandra
[cassandra@sht-sgmhadoopcm- ~]$ vim ~/.bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs export CASSANDRA_HOME=/usr/local/cassandra
export JAVA_HOME=/usr/java/jdk1..0_171
export PYTHON_HOME=/usr/local/python-2.7.
export PATH=$PYTHON_HOME/bin:$JAVA_HOME/bin:$CASSANDRA_HOME/bin:$CASSANDRA_HOME/tools/bin:$PATH:$HOME/bin:/usr/local/bin

5. 配置cassandra数据库

[root@sht-sgmhadoopcm- ~]# wget http://archive.apache.org/dist/cassandra/2.1.20/apache-cassandra-2.1.20-bin.tar.gz
[root@sht-sgmhadoopcm- ~]# tar -zxf apache-cassandra-2.1.-bin.tar.gz -C /usr/local/
[root@sht-sgmhadoopcm- ~]# cd /usr/local/
[root@sht-sgmhadoopcm- local]# ln -s apache-cassandra-2.1. cassandra
[root@sht-sgmhadoopcm- local]# chown -R cassandra.dba apache-cassandra-2.1./
[root@sht-sgmhadoopcm- local]# echo 'su - cassandra -c "cd /usr/local/cassandra/bin/ && nohup ./cassandra "' >> /etc/rc.local
[root@sht-sgmhadoopcm- local]# su - cassandra
[cassandra@sht-sgmhadoopcm- ~]$ mkdir /usr/local/cassandra/{data,commitlog,saved_caches,logs}
[cassandra@sht-sgmhadoopcm- ~]$ cat -n /usr/local/cassandra/conf/cassandra.yaml
…………………
cluster_name: 'MyCluster'
data_file_directories:
- /usr/local/cassandra/data
commitlog_directory: /usr/local/cassandra/commitlog
saved_caches_directory: /usr/local/cassandra/saved_caches
- seeds: "172.16.101.54"
listen_address: 172.16.101.54
start_native_transport: true
start_rpc: true
rpc_address: 0.0.0.0
broadcast_rpc_address: 172.16.101.54 …………………
[cassandra@sht-sgmhadoopcm- ~]$ cat -n /usr/local/cassandra/conf/cassandra-env.sh
…………………
MAX_HEAP_SIZE="4G"
HEAP_NEWSIZE="400M"
…………………

6. 启动cassandra

[cassandra@sht-sgmhadoopcm- ~]$ /usr/local/cassandra/bin/cassandra
....................
INFO :: No gossip backlog; proceeding ....................
[cassandra@sht-sgmhadoopcm- ~]$ cat /usr/local/cassandra/logs/system.log
.........................
INFO [main] -- ::, Server.java: - Starting listening for CQL clients on /0.0.0.0:...
INFO [main] -- ::, ThriftServer.java: - Binding thrift service to /0.0.0.0:
INFO [Thread-] -- ::, ThriftServer.java: - Listening for thrift clients...

7. 登录cassandra数据库

[cassandra@sht-sgmhadoopcm- ~]$ cqlsh 172.16.101.54
Connected to MyCluster at 172.16.101.54:.
[cqlsh 5.0. | Cassandra 2.1. | CQL spec 3.2. | Native protocol v3]
Use HELP for help.
cqlsh> [cassandra@sht-sgmhadoopcm- ~]$ cassandra-cli --host 172.16.101.54 --port
Connected to: "MyCluster" on 172.16.101.54/
Welcome to Cassandra CLI version 2.1. The CLI is deprecated and will be removed in Cassandra 2.2. Consider migrating to cqlsh.
CQL is fully backwards compatible with Thrift data; see http://www.datastax.com/dev/blog/thrift-to-cql3 Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit. [default@unknown]

Cassandra V2.1.20单机安装的更多相关文章

  1. ETCD 单机安装

    由于测试的需要,有时需要搭建一个单机版的etcd 环境,为了方便以后搭建查看,现在对单机部署进行记录. 一.部署单机etcd 下载 指定版本的etcd下载地址 ftp://ftp.pbone.net/ ...

  2. ELK学习实验002:Elasticsearch介绍及单机安装

    一 简介 ElasticSearch是一个基于Luncene的搜索服务器.它提供了一个分布式多用户能力全文搜索引擎,基于RESTful web接口,ElsticSearch使用Java开发的,并作为A ...

  3. (原) 1.1 Zookeeper单机安装

    本文为原创文章,转载请注明出处,谢谢 zookeeper 单机安装配置 1.安装前准备 linux系统(此文环境为Centos6.5) Zookeeper安装包,官网https://zookeeper ...

  4. Linux下Kafka单机安装配置方法(图文)

    Kafka是一个分布式的.可分区的.可复制的消息系统.它提供了普通消息系统的功能,但具有自己独特的设计.这个独特的设计是什么样的呢 介绍 Kafka是一个分布式的.可分区的.可复制的消息系统.它提供了 ...

  5. Ubuntu 下 Neo4j单机安装和集群环境安装

    1. Neo4j简介 Neo4j是一个用Java实现的.高性能的.NoSQL图形数据库.Neo4j 使用图(graph)相关的概念来描述数据模型,通过图中的节点和节点的关系来建模.Neo4j完全兼容A ...

  6. mysql 5.6.20的安装、配置服务、设置编码格式

    一.安装 安装环境        系统:Window 32        版本:Mysql 5.6.20 1. 首先从官网上http://dev.mysql.com/downloads/mysql/ ...

  7. Hbase单机安装部署

    Hbase单机安装部署 http://blogxinxiucan.sh1.newtouch.com/2017/07/27/Hbase单机安装部署/ 下载Hbase Hbase官网下载地址 http:/ ...

  8. 单机安装Hadoop

    单机安装hadoop ------------------------------------------------------------------ 操作系统:centos7 64 位 hado ...

  9. hadoop-0.20.2安装配置

    该环境在Vmware Workstation 12 上安装配置一共三台机器master,slave1,slave2. 操作系统:Cenos 7.0 hadoop 版本:hadoop-0.20.2,版本 ...

随机推荐

  1. kubernetes 实战2_命令_Configure Pods and Containers

    --以yaml格式输出:pod\configmap\service\ingress\deployment kubectl get pod platform-financeapi-deployment- ...

  2. Virtualbox-CentOS网络配置

    1.记下虚拟网卡IP 2. 配置网卡1.网卡2 网卡1 ---对应---eth0----NAT(网络地址转换)用来与外网通信 网卡2 ---对应---eth1----Host-only用来与主机通信 ...

  3. Oracle简单语句查询

    语法3-1:简单查询语句语法 SELECT [DISTINCT] * |列名称[AS][列别名],列名称[AS][列别名],...FROM 表名称[表别名]; 在整个简单查询之中,主要有两个子句完成: ...

  4. Django与CSRF 、AJAX

    CSRF(Cross-site request forgery)跨站请求伪造,是一种常见的网络攻击手段,具体内容和含义请大家自行百度. Django为我们提供了防范CSRF攻击的机制. 一.基本使用 ...

  5. Ajax_请求get,post案例

    1. 最原始的ajax请求方式 (1). get请求 <%@ Page Language="C#" AutoEventWireup="true" Code ...

  6. C#连接数据库open函数失败

    错误信息:在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误.未找到或无法访问服务器.请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接. (provider ...

  7. Discrete Log Algorithms :Baby-step giant-step

    离散对数的求解 1.暴力 2.Baby-step giant-step 3.Pollard’s ρ algorithm …… 下面搬运一下Baby-step giant-step 的做法 这是在 ht ...

  8. 力扣(LeetCode)965. 单值二叉树

    如果二叉树每个节点都具有相同的值,那么该二叉树就是单值二叉树. 只有给定的树是单值二叉树时,才返回 true:否则返回 false. 思路 递归 java版 /** * Definition for ...

  9. leecode第二十三题(合并K个排序链表)

    /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode ...

  10. 学习笔记16—Matlab 基础集

    1.常用相关 [r, p] = corr(X,Y), [r, p] = partialcorr(X,Y, Z) , 其中Z是协变量. 2.TD_age = importdata('F:\BrainAg ...