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. Hibernate——简单的增、删、改、查操作

    思路: 1.导入hibernate jar包 2.导入mysql jar包 3.创建数据库 4.创建java实体类 5.编写hibernate.cfg.xml配置文件 6.编写dao类 目录: 数据表 ...

  2. lua基础学习(六)

    一.lua协同程序coroutine 1.什么是协同(coroutine)?Lua 协同程序(coroutine)与线程比较类似:拥有独立的堆栈,独立的局部变量,独立的指令指针,同时又与其它协同程序共 ...

  3. C语言作业Ⅰ12

    一.我学到的内容 二.我的收获 时间 作业链接 我的收获 第一周 https://www.cnblogs.com/deng9/p/11576196.html#4369234 让我对这个专业有了新的认识 ...

  4. javaweb:关于HttpServletRequest介绍 (转)

    出处:https://www.cnblogs.com/xdp-gacl/p/3798347.html 一.HttpServletRequest介绍 HttpServletRequest对象代表客户端的 ...

  5. mysql-5.7.25安装以及使用

    1. wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz 2. ...

  6. 用Kindle阅读PDF最简单的3个方法!

    老实说,Kindle 对于PDF文件是很不友好的,经常会出现各种排版问题,所以,对电子阅读器方面比较了解的同学都知道,如果需要经常用阅读器查看PDF文件的话,最好还是买一款更大屏幕的设备,而Kindl ...

  7. 出大问题!webpack 多入口&&html模板在后端

    新公司前后端不分离,后端用的是php的twig 我用webpack做多入口文件的打包,虽然成功了.但是引入js和css是在twig上写死的根据文件名. 一开始没问题,因为就定死了那么几个global. ...

  8. java实现spark常用算子之cartesian

    import org.apache.spark.SparkConf;import org.apache.spark.api.java.JavaRDD;import org.apache.spark.a ...

  9. webstorm 如何去掉下划线

    当前webstorm版本:2018.3.5 百度了也没找到解决办法,最终结合了和群友的给的位置,找到了修改地方,只能怪版本迭代太快了,要适应 右上角Effects点掉就可以了

  10. 安卓-去除ActionBar的方法

    今天做一个播放器项目,由于要去除ActionBar,纠结好久,原来这么简单 记录一下 只需要修改AndroidManifest.xml文件中的主题即可 <application android: ...