产品环境中安装Cassandra 3.7

Chapter 1. Environment Prepare:

0. Environment description:

hardware: 7 commercial machine with 24 processors, 128 megabytes memory, 103G system disk + 3.6T*10 data disk
os: Red Hat 4.4.7-16 
ip: 192.168.1.11~17
cassandra: datastax-ddc-3.7.0
user: cassandra with sudo previlege.

1. Install JDK, recommend oracle JDK 8.

sudo  yum -y  install  jdk-8u101-linux-x64.rpm

I used a rpm package installment, it can save you time from configuration java_home and so on.

if you use openjdk, you will get a warn message as follows:

OpenJDK is not recommended. Please upgrade to the newest Oracle Java release

 

2.  Install jemalloc

sudo  yum -y  install  jemalloc.x86_64

if you miss the software, you will get a warn message as follows:

jemalloc shared library could not be preloaded to speed up memory allocations

3. Disable swap files and optimize system configuration

details, please see: https://docs.datastax.com/en/landing_page/doc/landing_page/recommendedSettingsLinux.html

Included in the file /etc/security/limits.conf:
# set for cassandra limits
coupang - memlock unlimited
coupang - nofile 100000
coupang - nproc 32768
coupang - as unlimited
 
 
For all installations, add the following line to /etc/sysctl.conf:
vm.max_map_count = 1048575
  
  
Disable swap files in the operations system
    sudo swapoff --all
To make this change permanent, remove all swap file entries from /etc/fstab.
  
  
Check the Java Hugepages setting
  echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag

if not do this, then you will get  warn messages as follows:

Unable to lock JVM memory (ENOMEM). This can result in part of the JVM being swapped out, especially with mmapped I/O enabled. Increase RLIMIT_MEMLOCK or run Cassandra as root.

Cassandra server running in degraded mode. Is swap disabled? : false,  Address space adequate? : true,  nofile limit adequate? : true, nproc limit adequate? : true

4. Update OHC

update ohc from 0.4.3 to 0.4.5, including jars: 

http://search.maven.org, search by ohc and download these, move them to $CASSANDRA_HOME/lib to replace ohc-core-0.4.3.jar & ohc-core-j8-0.4.3.jar
ohc-core-0.4.5.jar
ohc-core-j8-0.4.5.jar

 if not, you will get a warn message as follows:

Failed to load Java8 implementation ohc-core-j8 : java.lang.NoSuchMethodException: org.caffinitas.ohc.linked.UnsExt8.<init>(java.lang.Class)

 

Chapter 2. Cassandra Configuration files


cassandra.yaml

this is the primary configuration for cassandra.


 for some confidential reason, this part can't be shared.


jvm.options

configuration for java virtual machine. the machine has 24 processors and 128 M memory, so we use 32G heap and  15 ParallelGCThreads.

###########################################################################
#                             jvm.options                                 #
#                                                                         #
# - all flags defined here will be used by cassandra to startup the JVM   #
# - one flag should be specified per line                                 #
# - lines that do not start with '-' will be ignored                      #
# - only static flags are accepted (no variables or parameters)           #
# - dynamic flags will be appended to these on cassandra-env              #
###########################################################################
 
######################
# STARTUP PARAMETERS #
######################
 
# Uncomment any of the following properties to enable specific startup parameters
 
# In a multi-instance deployment, multiple Cassandra instances will independently assume that all
# CPU processors are available to it. This setting allows you to specify a smaller set of processors
# and perhaps have affinity.
#-Dcassandra.available_processors=number_of_processors
 
# The directory location of the cassandra.yaml file.
#-Dcassandra.config=directory
 
# Sets the initial partitioner token for a node the first time the node is started.
#-Dcassandra.initial_token=token
 
# Set to false to start Cassandra on a node but not have the node join the cluster.
#-Dcassandra.join_ring=true|false
 
# Set to false to clear all gossip state for the node on restart. Use when you have changed node
# information in cassandra.yaml (such as listen_address).
#-Dcassandra.load_ring_state=true|false
 
# Enable pluggable metrics reporter. See Pluggable metrics reporting in Cassandra 2.0.2.
#-Dcassandra.metricsReporterConfigFile=file
 
# Set the port on which the CQL native transport listens for clients. (Default: 9042)
#-Dcassandra.native_transport_port=port
 
# Overrides the partitioner. (Default: org.apache.cassandra.dht.Murmur3Partitioner)
#-Dcassandra.partitioner=partitioner
 
# To replace a node that has died, restart a new node in its place specifying the address of the
# dead node. The new node must not have any data in its data directory, that is, it must be in the
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值