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. php连接mysql,数据CRUD操作

    插入数据 <?php $name = $_GET['username']; $sex = $_GET['sex']; $hobby = $_GET['hobby']; $address = $_ ...

  2. 【神经网络与深度学习】Caffe使用step by step:caffe框架下的基本操作和分析

    caffe虽然已经安装了快一个月了,但是caffe使用进展比较缓慢,果然如刘老师说的那样,搭建起来caffe框架环境比较简单,但是完整的从数据准备->模型训练->调参数->合理结果需 ...

  3. RSA/RSA2 进行签名和验签

    package com.byttersoft.hibernate.erp.szmy.util; import java.io.ByteArrayInputStream; import java.io. ...

  4. Linux上面执行 Windows 命令(比如 重启服务)的简单方法

    1. 首先 基础是:openssh 还有 expect的包 2. 方法 安装openssh 转帖来自: https://www.jianshu.com/p/6e5bc39d386e 最近项目在搞Jen ...

  5. Nginx_Ubuntu

    一. 基本步骤 1.1 环境准备 开始前,请确认gcc g++开发类库是否装好,默认已经安装. 注: 等待linux下载更新功能准备好了 重启系统 在执行下载安装命令,如执行命令没有问题可以继续往下走 ...

  6. Microsoft BarCode Control 16.0属性

    Labview(2018)可通过Active调用Microsoft BarCode Control 16.0来生成条形码, 参考资料如下: 生成效果: 二维码: 条形码: 执行程序发现修改线条宽度不影 ...

  7. Spring Data Elasticsearch基本使用

    目录 1. 创建工程 2. 配置application.yaml文件 3. 实体类及注解 4. 测试创建索引 5. 增删改操作 5.1增加 5.2 修改(id存在就是修改,否则就是插入) 5.3 批量 ...

  8. python-day18(正式学习)

    目录 numpy模块 numpy简介 为什么要用numpy 创建numpy数组 numpy数组的基本属性 获取numpy数组的行列数 切割numpy数组 numpy数组元素替换 numpy数组的合并 ...

  9. mysql文本后面带换行符导致查询不到

    UPDATE tablename SET  FIELD = REPLACE(REPLACE(FIELD, CHAR(10), ''), CHAR(13), ''); CHAR(10):  换行符 CH ...

  10. chromedriver.exe下载

    淘宝的镜像地址可以下载: https://npm.taobao.org/mirrors/chromedriver/