📅  最后修改于: 2023-12-03 15:08:58.966000             🧑  作者: Mango
Cassandra是一个高度可扩展的分布式NoSQL数据存储系统。它是由Facebook开发,后来开源并成为Apache的顶级项目。本文将介绍如何在Ubuntu中安装Cassandra。
sudo apt update
sudo apt upgrade -y
echo "deb https://downloads.apache.org/cassandra/debian 40x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -
sudo apt update
sudo apt install cassandra
sudo systemctl start cassandra
sudo systemctl status cassandra
如果服务成功启动,则应该看到如下输出:
● cassandra.service - LSB: distributed storage system for structured data
Loaded: loaded (/etc/init.d/cassandra; generated)
Active: active (running) since Wed 2021-07-07 11:24:31 CST; 4s ago
Docs: man:systemd-sysv-generator(8)
Process: 22680 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)
Tasks: 24 (limit: 4915)
Memory: 954.0M
CGroup: /system.slice/cassandra.service
├─22688 java -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms805M -Xmx805M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss256k -XX
└─22696 sleep 10
Cassandra安装完成后,默认运行在本地节点,并使用本地IP地址127.0.0.1来访问。您可以使用CQL Shell连接到Cassandra,使用以下命令:
cqlsh 127.0.0.1
本文介绍了在Ubuntu中安装Cassandra的步骤。如果您需要一个高性能,高可用性的分布式NoSQL数据库,Cassandra是一个不错的选择。