Clustrix提供了一个名为clx的实用程序来管理其分布式ClustrixDB数据库。

命令在 /opt/clustrix/bin/ 下面

sudo su - clxm 用户即可使用

clx help : 输出帮助信息

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx status

Cluster Name:    cld32d48dc6ff9c79d

Cluster Version: 9.2

Cluster Status:   OK

Cluster Size:    3 nodes - 8 CPUs per Node

Current Node:    ip-10-1-3-151 - nid 1

集群节点   主机名   状态         集群IP       节点TPS     磁盘使用   磁盘预分配

nid |    Hostname    | Status |  IP Address | TPS |       Used      |  Total

----+----------------+--------+-------------+-----+-----------------+--------

1 |  ip-10-1-3-151 |    OK  |  10.1.3.151 |   0 |  131.7M (0.19%) |   68.9G

2 |  ip-10-1-3-242 |    OK  |  10.1.3.242 |   0 |  131.1M (0.19%) |   68.9G

3 |   ip-10-1-3-88 |    OK  |   10.1.3.88 |  18 |  131.0M (0.19%) |   68.9G

----+----------------+--------+-------------+-----+-----------------+--------

18 |  393.8M (0.19%) |  206.6G

clx alters: 查看集群正在做alter操作的状态

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx alter

Table   | Est Completion | Rows Read | Est. Total Rows |      Start Time      |  Est. Complete time

---------+----------------+-----------+-----------------+----------------------+---------------------

sbtest1 |          31.6% |    300501 |          949760 |  2019-11-27 10:02:26 |  2019-11-27 10:02:29

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx alter

Table   | Est Completion | Rows Read | Est. Total Rows |      Start Time      |  Est. Complete time

---------+----------------+-----------+-----------------+----------------------+---------------------

sbtest1 |          62.4% |    592977 |          949760 |  2019-11-27 10:02:26 |  2019-11-27 10:02:29

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx alter

Table   | Est Completion | Rows Read | Est. Total Rows |      Start Time      |  Est. Complete time

---------+----------------+-----------+-----------------+----------------------+---------------------

sbtest1 |          84.5% |    802508 |          949760 |  2019-11-27 10:02:26 |  2019-11-27 10:02:29

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx alter

Table   | Est Completion | Rows Read | Est. Total Rows |      Start Time      |  Est. Complete time

---------+----------------+-----------+-----------------+----------------------+---------------------

sbtest1 |          97.1% |    922622 |          949760 |  2019-11-27 10:02:26 |  2019-11-27 10:02:29

clx cmd:  集群执行shell命令

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx cmd 'date'

--------------------------------------------------------------------------------

{nid: 1, hostname: ip-10-1-3-151, ip: 10.1.3.151}

Wed Nov 27 10:04:22 UTC 2019

--------------------------------------------------------------------------------

{nid: 2, hostname: ip-10-1-3-242, ip: 10.1.3.242}

Wed Nov 27 10:04:23 UTC 2019

--------------------------------------------------------------------------------

{nid: 3, hostname: ip-10-1-3-88, ip: 10.1.3.88}

Wed Nov 27 10:04:23 UTC 2019

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx cmd 'df -lh | grep data'

--------------------------------------------------------------------------------

{nid: 1, hostname: ip-10-1-3-151, ip: 10.1.3.151}

/dev/xvdf        99G   79G   16G  84% /data

--------------------------------------------------------------------------------

{nid: 2, hostname: ip-10-1-3-242, ip: 10.1.3.242}

/dev/xvdf        99G   79G   16G  84% /data

--------------------------------------------------------------------------------

{nid: 3, hostname: ip-10-1-3-88, ip: 10.1.3.88}

/dev/xvdf        99G   79G   16G  84% /data

clx dbstop: 集群关闭

clx --node=3 dbstop: 关闭集群nid=3的节点

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx --node=3 dbstop

Success: stop_job krobix run on ip-10-1-3-88.

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx s

Cluster Name:    cld32d48dc6ff9c79d

Cluster Version: 9.2

Cluster Status:   ATTN

Cluster Size:    3 nodes - 8 CPUs per Node

Current Node:    ip-10-1-3-151 - nid 1

nid |    Hostname    |  Status |  IP Address | Zone | TPS |       Used      |  Total

----+----------------+---------+-------------+------+-----+-----------------+--------

1 |  ip-10-1-3-151 |     OK  |  10.1.3.151 |    0 |   1 |  140.6M (0.20%) |   68.9G

2 |  ip-10-1-3-242 |     OK  |  10.1.3.242 |    0 |   0 |  145.8M (0.21%) |   68.9G

3 |   ip-10-1-3-88 |   DOWN  |   10.1.3.88 |    0 |   0 |       0 (0.00%) |       0

----+----------------+---------+-------------+------+-----+-----------------+--------

1 |  286.4M (0.20%) |  137.8G

clx dbstart: 集群重启

clx --node=3 dbstart:启动集群nid=3的节点

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx --node=3 dbstart

Success: start_job krobix run on ip-10-1-3-88.

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx s

Cluster Name:    cld32d48dc6ff9c79d

Cluster Version: 9.2

Cluster Status:   OK

Cluster Size:    3 nodes - 8 CPUs per Node

Current Node:    ip-10-1-3-151 - nid 1

nid |    Hostname    | Status |  IP Address | TPS |       Used      |  Total

----+----------------+--------+-------------+-----+-----------------+--------

1 |  ip-10-1-3-151 |    OK  |  10.1.3.151 |   3 |  136.1M (0.19%) |   68.9G

2 |  ip-10-1-3-242 |    OK  |  10.1.3.242 |   0 |  141.6M (0.20%) |   68.9G

3 |   ip-10-1-3-88 |    OK  |   10.1.3.88 |   0 |  140.2M (0.20%) |   68.9G

----+----------------+--------+-------------+-----+-----------------+--------

3 |  417.9M (0.20%) |  206.6G

clx dbrestart:  集群重启

clx disks: 查看集群磁盘信息

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx disks

nid |    Hostname    | Status | Read IOPS | Write IOPS | Sync IOPS | Total IOPS

----+----------------+--------+-----------+------------+-----------+-----------

1 |  ip-10-1-3-151 |    OK  |        15 |          0 |         0 |         15

2 |  ip-10-1-3-242 |    OK  |        15 |          0 |         0 |         16

3 |   ip-10-1-3-88 |    OK  |        15 |          0 |         0 |         15

----+----------------+--------+-----------+------------+-----------+-----------

47 |          0 |         0 |         47

clx space: 查看集群空间信息

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx space

nid |    Hostname    | Status |       Undo      |       Perm      |    Temp    |       Used      | DB Total | FS Free

----+----------------+--------+-----------------+-----------------+------------+-----------------+----------+--------

1 |  ip-10-1-3-151 |    OK  |  256.0K (0.00%) |  138.2M (0.20%) |  0 (0.00%) |  138.7M (0.20%) |    68.9G |   15.2G

2 |  ip-10-1-3-242 |    OK  |  256.0K (0.00%) |  137.6M (0.20%) |  0 (0.00%) |  138.2M (0.20%) |    68.9G |   15.2G

3 |   ip-10-1-3-88 |    OK  |  256.0K (0.00%) |  137.7M (0.20%) |  0 (0.00%) |  138.2M (0.20%) |    68.9G |   15.2G

----+----------------+--------+-----------------+-----------------+------------+-----------------+----------+--------

768.0K (0.00%) |  413.5M (0.20%) |  0 (0.00%) |  415.0M (0.20%) |   206.6G |   45.6G

clx cache:立即使用节点信息更新文件系统缓存。通常不需要执行此命令

clx pull: 拷贝其他节点文件到本地

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx -n 3 pull t.txt

--------------------------------------------------------------------------------

{nid: 3, hostname: ip-10-1-3-88, ip: 10.1.3.88}

Copied ip-10-1-3-88:/home/clxm/t.txt to /home/clxm/t.txt.ip-10-1-3-88 in 0.00 seconds

clxm@p2cn1uclx101m_10.248.100.241 ~]$ ls

a.log  tttt.txt  t.txt.ip-10-1-3-88

clx push: 发送本地文件到其他节点

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx -n 2 -n 3 push b.log

--------------------------------------------------------------------------------

{nid: 2, hostname: ip-10-1-3-242, ip: 10.1.3.242}

b.log pushed to ip-10-1-3-242:/home/clxm/b.log in 0.02 seconds

--------------------------------------------------------------------------------

{nid: 3, hostname: ip-10-1-3-88, ip: 10.1.3.88}

b.log pushed to ip-10-1-3-88:/home/clxm/b.log in 0.02 seconds

clx slave: 查看从库状态(在slave上执行)

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx slave

Slave   | NID | Enabled | master_log_file | log_file_seq | log_file_pos | seconds_behind_master | TPS

---------+-----+---------+-----------------+--------------+--------------+-----------------------+----

default |   4 |    True |    clustrix-bin |            1 |          451 |                     0 |   0

clx debugdump: 从集群中收集详细的调试信息

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx debugdump a.log

Dumped debug information to a.log in 1.212 seconds

clx cp: 集群执行cp命令,具体option参考debug输出日志

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx cp "version"

--------------------------------------------------------------------------------

{nid: 1, hostname: ip-10-1-3-151, ip: 10.1.3.151}

clustrix-9.2

--------------------------------------------------------------------------------

{nid: 2, hostname: ip-10-1-3-242, ip: 10.1.3.242}

clustrix-9.2

--------------------------------------------------------------------------------

{nid: 3, hostname: ip-10-1-3-88, ip: 10.1.3.88}

clustrix-9.2

clxm@p2cn1uclx101m_10.248.100.241 ~]$ clx cp "device list"

--------------------------------------------------------------------------------

{nid: 1, hostname: ip-10-1-3-151, ip: 10.1.3.151}

Device manifest:

Devid Path                   Status

------------------------------------

1 /data/clustrix/device1 online

--------------------------------------------------------------------------------

{nid: 2, hostname: ip-10-1-3-242, ip: 10.1.3.242}

Device manifest:

Devid Path                   Status

------------------------------------

1 /data/clustrix/device1 online

--------------------------------------------------------------------------------

{nid: 3, hostname: ip-10-1-3-88, ip: 10.1.3.88}

Device manifest:

Devid Path                   Status

------------------------------------

1 /data/clustrix/device1 online

clx logdump: 导出集群日志

clx logdump user > user.log          导出集群用户登录登出日志

clx logdump debug > debug.log    导出集群debug日志

clx logdump nanny > nanny.log     导出集群nanny日志

clx logdump query > query.log      导出集群慢SQL日志

clx logdump clustrix > clustrix.log   导出集群通用日志

clx -s '2019-11-27 09:00:00' -e '2019-11-27 10:00:00' logdump query   导出某一时间段日志,-s 开始时间,-e结束时间

4. ClustrixDB CLX命令详解的更多相关文章

  1. Git初探--笔记整理和Git命令详解

    几个重要的概念 首先先明确几个概念: WorkPlace : 工作区 Index: 暂存区 Repository: 本地仓库/版本库 Remote: 远程仓库 当在Remote(如Github)上面c ...

  2. linux yum命令详解

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  3. Linux下ps命令详解 Linux下ps命令的详细使用方法

    http://www.jb51.net/LINUXjishu/56578.html Linux下的ps命令比较常用 Linux下ps命令详解Linux上进程有5种状态:1. 运行(正在运行或在运行队列 ...

  4. Docker命令详解

    Docker命令详解   最近学习Docker,将docker所有命令实验了一番,特整理如下: # docker --help Usage: docker [OPTIONS] COMMAND [arg ...

  5. linux awk命令详解

    linux awk命令详解 简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分 ...

  6. android adb 命令详解

    ADB (Android Debug Bridge)  是android SDK中的工具,需要先配置环境变量才能使用.起调试桥的作用,可以管理安卓设备.(也叫debug工具) ---------查看设 ...

  7. Git 常用命令详解

    Git 是一个很强大的分布式版本管理工具,它不但适用于管理大型开源软件的源代码(如:linux kernel),管理私人的文档和源代码也有很多优势(如:wsi-lgame-pro) Git 的更多介绍 ...

  8. Top 命令详解

    Top 命令详解 先感受一下top命令的执行结果吧!哈哈-- top - 17:32:34 up 3 days, 8:04, 5 users, load average: 0.09, 0.12, 0. ...

  9. Ruby Gem命令详解

    转自:http://www.jianshu.com/p/728184da1699 Gem介绍: Gem是一个管理Ruby库和程序的标准包,它通过Ruby Gem(如 http://rubygems.o ...

随机推荐

  1. VGA显示正圆

    接着上次的随笔,既然VGA时序已经实现了,那么就显示点东西看看吧. 想显示个圆,但是无从下手,参考了这篇文章:https://user.qzone.qq.com/1241003385/blog/154 ...

  2. python pytorch numpy DNN 线性回归模型

    1.直接奉献代码,后期有入门更新,之前一直在学的是TensorFlow, import torch from torch.autograd import Variable import torch.n ...

  3. 【miscellaneous】华为智能视频监控系统设计解决方案

    [导读] 近年来,随着经济的快速增长.社会的迅速进步,校园.工厂园区.中小企业.楼宇等领域对安全防范和现场记录报警系统的需求与日俱增,视频监控在工作.生活各方面得到了非常广泛的应用. 1.中小型视频监 ...

  4. [转帖]2018年全球ERP软件行业市场规模与发展趋势分析 云ERP将兴起【组图】

    2018年全球ERP软件行业市场规模与发展趋势分析 云ERP将兴起[组图] https://www.qianzhan.com/analyst/detail/220/190215-4b1d6868.ht ...

  5. Linux-usermod:增加已建立用户的用户组

    usermod --help -g, --gid GROUP force use GROUP as new primary group -G, --groups GROUPS new list of ...

  6. numpy数组的索引和切片

    numpy数组的索引和切片 基本切片操作 >>> import numpy as np >>> arr=np.arange(10) >>> arr ...

  7. 架构师必备,带你弄清混乱的JAVA日志体系!

    作者:孤独烟 出处:http://rjzheng.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任 ...

  8. nginx的高级配置和优化

    Nginx的高级配置(优化) 针对内核的配置优化 1)net.core.netdev_max_backlog 表示当网络接口接收数据包的速度大于内核处理这些包块的时候,允许发送到队列的数据包的最大数目 ...

  9. win 与Linux 的hosts文件地址

    win(phpstudy):C:/Windows/System32/drivers/etc/hosts linux:  /etc/hosts

  10. mysql 的主从

    MySQL的Replication(英文为复制)是一个多MySQL数据库做主从同步的方案,特点是异步复制,广泛用在各种对MySQL有更高性能.更高可靠性要求的场合.与之对应的是另一个同步技术是MySQ ...