- 列出包含特定文本的文件
1 | 在 dir 目录下查找包含 content 的文件 |
- 查找特定文本在文件的行数
1 | grep -n 'SET timestamp=15925248..' slow.log |
- 读取文件前后特定行的文本
1 | 读取 slow.log 文件前 100 行文本 |
- 截取文本中第 from 行到 to 行之间的文本
1 | sed -n 'from,to'p slow.log |
- 获取文件中特定行的文本
1 | sed -n 'row'p slow.log |
1 | # 在 dir 目录下查找包含 content 的文件 |
1 | grep -n 'SET timestamp=15925248..' slow.log |
1 | # 读取 slow.log 文件前 100 行文本 |
1 | sed -n 'from,to'p slow.log |
1 | sed -n 'row'p slow.log |
目前我们团队实施的项目后端采用了基于 Springcloud 的微服务,其中 Eureka 用作注册中心,其他服务作为 Eureka 客户端接入。采用 Prometheus 和 Grafana 可以有效的监控微服务的运行情况。
这篇文章中,我会编写 2 个微服务集成 Prometheus,并通过 docker 来安装 Prometheus 和 Grafana 来展示对微服务的监控。
以下我们将基于 elasticsearch-6.6.0 版本,在单机上部署 3 个节点组成的集群。3个节点都用作候选主节点,且同时作为数据节点。
在数据的使用与传输过程中,经常需要将敏感信息脱敏的过程。比如需要将用户信息表中的身份证号码中间 几位进行隐藏等等。
mysql 中常用的脱敏方法有以下两种。
1 | SELECT |
1 | SELECT |
# update select 语句(注意:必须使用 inner join)
# 语法 update ta inner join (select yy from tb) tc on ta.id = tc.id set ta.xx = tc.yy
-- 行政处罚信息表
UPDATE T_XYXX_XZCFXX ori
INNER JOIN (
SELECT
uuid,
INSERT ( FDDBR, 1, 1, '*' ) AS NAME,
CONCAT(
'000000',
'****',
RIGHT ( FDDBRZJHM, 8 )
) AS idcardno
FROM
T_XYXX_XZCFXX
) nosense ON ori.uuid = nosense.uuid
SET ori.FDDBR = nosense.NAME,
ori.FDDBRZJHM = nosense.idcardno;