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. 灰度图像的自动阈值分割(Otsu 法)

    关于otsu分割方法,这个文章讲的是最好的,清晰易懂,一看就是作者认真思考过的. 因为在看这个算法的时候我就想,如果一个很大的图像上,大部分像素值都在0 - 50范围内,但是有很小一块像素值在240的 ...

  2. OUTLOOK、foxmail等无法直接打开邮件中的超级链接问题

         部分电脑,在OUTLOOK或Foxmail收到隔离邮件通知时,点击发送或删除时,提示“一般性错误,*******************,找不到应用程序”.或打开其它HTML格式的邮件正文中 ...

  3. selenium—用NoSuchElementException异常判断页面元素是否存在

    一.知识补充 1.find_element的一种使用方法: find_element(by=方法,value=值) 例如: find_element(by="id",value=& ...

  4. HDU 1024 Max Sum Plus Plus (动态规划、最大m子段和)

    Max Sum Plus Plus Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others ...

  5. [转帖]X86_64平台上利用qemu安装aarch64架构的虚拟机

    X86_64平台上利用qemu安装aarch64架构的虚拟机 https://blog.csdn.net/chenxiangneu/article/details/78955462 遇到原作者一样的问 ...

  6. GTS原理、架构

    全局事务服务(Global Transaction Service,简称 GTS)是阿里新推出的分布式事务处理方案. 1. GTS 的目标 GTS是一个面向互联网交易场景的分布式事务解决方案. 制约分 ...

  7. springboot2.0结合fastdfs实现文件分布式上传

    1. 引入依赖 在父工程中,我们已经管理了依赖,版本为: <fastDFS.client.version>1.26.7</fastDFS.client.version> 因此, ...

  8. Python基础数据类型int

    整型int 赋值运算符 a=1 a+=1 #a=a+1 a-=1 #a=a-1 a*=1 #a=a*1 a/=1 #a=a/1 a**=1 #a=a**1 a%=1 #a=a%1 算数运算符 + - ...

  9. python告诉你啥是佩奇

    被<啥是佩奇>这支广告片刷屏了. 佩奇明明是个喜剧角色, 但是看哭了所有人. <啥是佩奇>??? 效果图如下: # -*- coding:utf-8 -*- from turt ...

  10. maven配置生成可执行的jar:maven-shade-plugin

    默认打包生成的jar是不能直接运行的,因为带有main方法的信息不会添加到mainifest中,需要借助maven-shade-plugin <project> ... <build ...