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. selenium:css_selector定位详解

    selenium:css_selector定位详解(css selector和xpath的比较) 来源:https://www.cnblogs.com/haifeima/p/10138154.html ...

  2. 简述前后端项目RSA+AES加解密

    一.登录机制 在项目中,我们可以大致得出一个登录的过程,主要分为  登录验证.登录保持.退出三个部分.登录验证是指客户端提供用户名和密码,向服务器提出登录请求,服务器判断客户端是否可以登录并向客户端确 ...

  3. redhat java配置

    原来的java版本为1.4 whereis java后 将java原来的目录全部删除 拿来新的1.8的安装好的java包 vi /etc/profile插入 JAVA_HOME=/usr/local/ ...

  4. 第八周总结and实验

    1.实验目的 理解异常的基本概念:掌握异常处理方法及熟悉常见异常的捕获方法. 2.实验要求 练习捕获异常.声明异常.抛出异常的方法.熟悉try和catch子句的使用.掌握自定义异常类的方法. 3.实验 ...

  5. Spring Cloud 使用Feign调用服务传递Header中的参数

    1.使用Feign 调用其他微服务,尤其是在多级调用的同时,需要将一些共同的参数传递至下一个服务,如:token.比较方便的做法是放在请求头中,在Feign调用的同时自动将参数放到restTempla ...

  6. Python流程控制与while 循环(day01)

    一:流程控制 假如把写程序比做走路,那我们到现在为止,一直走的都是直路,还没遇到过分叉口,想象现实中,你遇到了分叉口,然后你决定往哪拐必然是有所动机的.你要判断哪条叉路是你真正要走的路,如果我们想让 ...

  7. <<C++ Primer>> 第三章 字符串, 向量和数组 术语表

    术语表 第 3 章 字符串, 向量和数组 begin: 是 string 和 vector 的成员,返回指向第一个元素的迭代器.也是一个标准库函数,输入一个数字,返回指向该数字首元素的指针.    缓 ...

  8. C++中类模板的概念和意义

    1,在 C++ 中是否能够将泛型的思想应用于类? 1,函数模板是将泛型编程的思想应用于函数,就有了函数模板: 2,可以,常用的 C++ 标准库就是 C++ 中的标准模板库,C++ 中的 STL 就是将 ...

  9. HNUSTOJ-1512 奇怪的导弹(暴力)

    1512: 奇怪的导弹 时间限制: 3 Sec  内存限制: 32 MB提交: 31  解决: 13[提交][状态][讨论版] 题目描述 最近国际形势比较紧张,就拿中国来说,比如南海问题,钓鱼岛事件等 ...

  10. Git-版本控制 (三)

    前面两篇我们成功安装了Git,并且成功创建了我们的版本库. 创建了版本库,怎么可以不往里面放内容呢,所以今天的任务就是学会将文件放入至我们的版本库中...... 首先,我们点开我们的"Git ...