cassandra安裝


 

單節點安裝

cassandra由Java開發,需要提前配置JDK環境

 

開源版本安裝

=======================================================

下載地址

http://archive.apache.org/dist/cassandra/

 

wget http://archive.apache.org/dist/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz

wget  http://archive.apache.org/dist/cassandra/3.11.6/apache-cassandra-3.11.6-src.tar.gz

wget http://mirrors.tuna.tsinghua.edu.cn/apache/cassandra/2.1.21/apache-cassandra-2.1.21-bin.tar.gz

vim conf/cassandra-env.sh

MAX_HEAP_SIZE="4G"

HEAP_NEWSIZE="800M"

 

vim conf/cassandra.yaml

authenticator: PasswordAuthenticator

 

useradd cassandra

chown -R cassandra.cassandra /opt/app/apache-cassandra-2.1.21/

 

pkill -f CassandraDaemon

su - cassandra -c /opt/app/apache-cassandra-2.1.21/bin/cassandra

# netstat -tunlp |grep 9042
tcp        0      0 127.0.0.1:9042          0.0.0.0:*               LISTEN      6724/java 

 

 cd /opt/app/apache-cassandra-2.1.21

./bin/cqlsh -u cassandra -p cassandra localhost

CREATE USER automng WITH PASSWORD 'Automng_123' SUPERUSER ;

./bin/cqlsh -u automng -p Automng_123 127.0.0.1

這里使用的是公有雲,首先要開放其9042端口,然后修改幾個IP地址,修改為內網IP即可,不需要填寫公網IP

# cat conf/cassandra.yaml |grep 172
          - seeds: "172.21.0.12"
listen_address: 172.21.0.12
rpc_address: 172.21.0.12

然后重啟cassandra

pkill -f CassandraDaemon

su - cassandra -c /opt/app/apache-cassandra-2.1.21/bin/cassandra

 

3.11.6安裝記錄

tar -xvf apache-cassandra-3.11.6-bin.tar.gz -C /opt/app/

chown -R cassandra.cassandra /opt/app/apache-cassandra-3.11.6/

修改Java堆內存與密碼認證方式后,然后啟動

su - cassandra -c /opt/app/apache-cassandra-3.11.6/bin/cassandra

./bin/cqlsh -u cassandra -p cassandra localhost

 

su: warning: cannot change directory to /home/cassandra: No such file or directory

root@db:~# mkdir /home/cassandra
root@db:~# chown -R  cassandra.cassandra /home/cassandra/
root@db:~# chmod -R 755 /home/cassandra/

 

企業版安裝

================================================================

附·官方個人電腦安裝指導

Your Own Computer 
This option is provided for users that really prefer to run exercises outside 
of a virtual machine or cloud instance. 
However due to the variety of different computing environments, no other 
support is provided outside of this document. We recommend using one of 
the other exercise environment options instead to avoid setup issues.
Prerequisite Software Java
8 – OpenJDK 8 or Oracle Java SE 8 (1.8.0_151 minimum) Python 2.7.x – https://www.python.org/downloads/ DataStax Python driver – https://github.com/datastax/python-driver

Requirements CPU – Multi-core 64-bit CPU Disk Size – 10GB free space Memory – 6GB or more Operating System – Mac OSX / Linux
Instructions
1. Download the DataStax Enterprise 6.0 tarball, available from the DataStax website. 2. Download DS201: Data Files and Scripts from the DS201 Course Assets page and extract the resulting zip file. 3. The extracted files include a script, labwork/config_node, which assumes that you will be installing DSE in the location /home/ubuntu. Edit the script to match the location you will be doing the exercises from. 4. Open a terminal window to start the DS201 exercises

 

 

Installing DataStax Enterprise 6.8 on Debian-based systems using APT

 官方安裝指南-ubantu版

java -version
sudo apt-get install libaio1
 
        
curl -L https://downloads.datastax.com/enterprise/dse.tar.gz | tar xz
curl -L https://downloads.datastax.com/enterprise/dse-version_number-bin.tar.gz | tar xz
curl -L https://downloads.datastax.com/enterprise/dse-6.8.1-bin.tar.gz | tar xz

tar -xzvf dse-6.8.1-bin.tar.gz

In the installation_location, make the directories for data and logging directories. For example

mkdir dse-data &&
  cd dse-data && 
  mkdir data &&
  mkdir commitlog && 
  mkdir saved_caches &&
  mkdir hints && 
  mkdir cdc_raw



cd installation_location/resources/cassandra/conf

Update the following lines in the cassandra.yaml file
data_file_directories: 
  - full_path_to_installation_location/dse-data/data
  commitlog_directory: full_path_to_installation_location/dse-data/commitlog
  saved_caches_directory: full_path_to_installation_location/dse-data/saved_caches
  hints_directory: full_path_to_installation_location/dse-data/hints
  cdc_raw_directory: full_path_to_installation_location/cdc_raw

注意事項

For production, be sure to change the cassandra user. 這里有創建用戶的說明。

 

日志設置

修改logback.xml中的cassandra.logdir為/opt/data/dse-data/logs


日志目錄設置,dse的一些設置認准了/var/log/cassandra
mkdir -p /var/log/cassandra/
chmod -R 777 /var/log/cassandra/

 

 

修改密碼權限

https://docs.datastax.com/en/security/5.1/security/Auth/secEnableDseAuthenticator.html

 

創建用戶

https://docs.datastax.com/en/security/6.8/security/Auth/secCreateRootAccount.html

./cqlsh -u cassandra -p cassandra
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 6.8.0 | DSE 6.8.1 | CQL spec 3.4.5 | DSE protocol v2]
Use HELP for help.
cassandra@cqlsh> 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM