【发布时间】:2018-04-10 05:38:18
【问题描述】:
当前 commitlog 目录指向 Directory1。我想将它更改为不同的目录 D2。迁移应该如何?
【问题讨论】:
当前 commitlog 目录指向 Directory1。我想将它更改为不同的目录 D2。迁移应该如何?
【问题讨论】:
我们就是这样做的。我们有一个与 Cassandra 1.1.2 对话的负载平衡客户端,每个客户端都存在于每个 Cassandra 节点上。
systemctl stop <your service name>
iostat 2 - 磁盘活动应该接近于零nodetool gossipinfonodetool disablegossip
nodetool flush nodetool drain
systemctl stop cassandra
vi /etc/cassandra/default.conf/cassandra.yaml
systemctl start cassandra
tail -F /var/log/cassandra/system.log
nodetool ring
systemctl start <your service here>
请注意,我们不需要自己手动复制提交日志文件。冲洗和排水处理了这一点。然后文件慢慢地重新出现在新的commitlog_dir 位置。
【讨论】:
您可以更改 cassandra.yaml 中的提交日志目录(键:“commitlog_directory”)并将所有日志复制到新目标。
commitlog_directory
存储提交日志的目录。默认位置: 软件包安装:/var/lib/cassandra/commitlog Tarball 安装: install_location/data/commitlog 以获得最佳写入 性能,将提交日志放在单独的磁盘分区上,或者 (理想情况下)与数据文件目录分开的物理设备。 因为提交日志只是追加的,所以一个 HDD 是可以接受的 这个目的。
【讨论】: