Rootop 服务器运维与web架构

2024-03-14
发表者 Venus
doris维护部分查询方法已关闭评论

doris维护部分查询方法

# 查看数据库id对应的数据库名
mysql> show database 11237;

# 查看表id对应的表名 
mysql> show table 239829;

# 查看表有哪些分区
mysql> show partitions from base_transfer\G;

# 过滤
mysql> show partitions from base_transfer where `partitionid` = 239780; # 值不能加引号,要不查不出来

# 查看建表语句
mysql> show create table base_transfer\G;

# 查看副本状态
mysql> ADMIN SHOW REPLICA STATUS FROM base_transfer;
+----------+-----------+-----------+---------+-------------------+--------------------+------------------+------------+------------+-------+--------+--------+
| TabletId | ReplicaId | BackendId | Version | LastFailedVersion | LastSuccessVersion | CommittedVersion | SchemaHash | VersionNum | IsBad | State  | Status |
+----------+-----------+-----------+---------+-------------------+--------------------+------------------+------------+------------+-------+--------+--------+
| 270021   | 270022    | 11126     | 1       | -1                | 1                  | 1                | 564419587  | 1          | false | NORMAL | OK     |
| 270023   | 270024    | 11180     | 1       | -1                | 1                  | 1                | 564419587  | 1          | false | NORMAL | OK     |
| 270025   | 270026    | 11181     | 1       | -1                | 1                  | 1                | 564419587  | 1          | false | NORMAL | OK     |

# 过滤
mysql> ADMIN SHOW REPLICA STATUS FROM base_transfer where status != 'OK';
更多状态参考:https://doris.apache.org/zh-CN/docs/2.0/sql-manual/sql-reference/Database-Administration-Statements/ADMIN-SHOW-REPLICA-STATUS

# 查看分片
mysql> show tablet 270891;

表table -> 分区partition -> 分片(桶)tablet


# 数据库id 表id从web中查看/System?path=/dbs/11237,或者通过 show proc "/"; 查看
SHOW PROC '/dbs/11237/1563242/partitions/1563239/1563243';

更多show proc用法参考:https://doris.apache.org/zh-CN/docs/2.0/sql-manual/sql-reference/Show-Statements/SHOW-PROC

# 建表
CREATE TABLE `base_test111111` (
  `block_number` largeint(40) NULL,
  `block_time` datetime NULL,
  `trans_hash` varchar(120) NULL,
  `log_index` int(11) NULL,
  `from_address` varchar(120) NULL,
  `to_address` varchar(120) NULL,
  `quantity` varchar(120) NULL,
  `amount_usd` varchar(120) NULL,
  `token_id` varchar(120) NULL,
  `token_address` varchar(120) NULL,
  `wallet_from` varchar(120) NULL,
  `wallet_to` varchar(120) NULL,
  `_id` varchar(120) NOT NULL,
  INDEX block_number_index (`block_number`) USING BITMAP COMMENT '区块号',
  INDEX block_time_index (`block_time`) USING BITMAP COMMENT '区块时间'
) ENGINE=OLAP
UNIQUE KEY(`block_number`, `block_time`, `trans_hash`, `log_index`)
COMMENT 'base_transfer交易表'
PARTITION BY RANGE(`block_time`)
(
PARTITION month_202401 VALUES [('2024-01-01 00:00:00'), ('2024-02-01 00:00:00')),
PARTITION month_202402 VALUES [('2024-02-01 00:00:00'), ('2024-03-01 00:00:00')),
PARTITION month_202403 VALUES [('2024-03-01 00:00:00'), ('2024-04-01 00:00:00')),
PARTITION month_202404 VALUES [('2024-04-01 00:00:00'), ('2024-05-01 00:00:00')),
PARTITION month_202405 VALUES [('2024-05-01 00:00:00'), ('2024-06-01 00:00:00'))
)
DISTRIBUTED BY HASH(`trans_hash`) BUCKETS 10 # 设置桶的数量,1.2.2版本之后可以设置为自动 BUCKETS AUTO
PROPERTIES (
"replication_num" = "3" # 副本集数,也就是每个桶有几个副本。
);

2024-03-08
发表者 Venus
juniper重启web管理界面服务已关闭评论

juniper重启web管理界面服务

juniper web配置界面,点开菜单后,右侧的配置信息不显示,要么显示不完整,要么修改内容无法保存。
但是通过命令行是能看到配置信息,所以问题出在web服务上。

固件版本是 20.4R2.7

通过浏览器F12调试模式,看到是往下面地址发起请求

https://10.1.2.1:60000/cache.php

响应内容

{
    "status": true,
    "jweb-config-cache": "\/jail\/var\/cache\/.91714653_root_cfg.json",
    "jweb-last-cache-update-time": "1709866189"
}

推测 /jail/var/cache/ 这个路径下是临时缓存文件,进到此目录,删掉文件。

root@juniper1% cd /jail/var/cache/
root@juniper1% ls -l
total 372
-rw-r--r--  1 root  wheel  77776 Mar  7 21:50 .2119246741_root_cfg.json
-rw-r--r--  1 root  wheel  34373 Mar  7 21:47 .91311285_super_lpad.json
-rw-r--r--  1 root  wheel  77776 Mar  7 21:50 .91714653_root_cfg.json

root@juniper1% rm -f .xxxxx # 删除了 以点开头的文件 .xxxxx

# 重启web界面服务
root@juniper1> restart web-management 

配置界面功能恢复。

web界面配置还是相对不如命令行稳定。

2024-03-07
发表者 Venus
juniper防火墙面板alarm灯橙色已关闭评论

juniper防火墙面板alarm灯橙色

root> show system alarms 
2 alarms currently active
Alarm time               Class  Description
2024-03-07 00:42:55 UTC  Minor  Autorecovery information needs to be saved
2024-03-07 00:42:53 UTC  Minor  Rescue configuration is not set

root> request system autorecovery state save 
Saving config recovery information
Saving license recovery information
Saving BSD label recovery information

root> request system configuration rescue save 

root> 

root> show system alarms 
No alarms currently active

这样面板上的警报灯就灭了。

2024-03-07
发表者 Venus
juniper关闭自动更新已关闭评论

juniper关闭自动更新

# 控制台经常提示

Auto Image Upgrade: DHCP INET Client Bound interfaces :

Auto Image Upgrade: DHCP INET Client Unbound interfaces : ge-0/0/0.0
ge-0/0/7.0

Auto Image Upgrade: DHCP INET6 Client Bound interfaces :

Auto Image Upgrade: DHCP INET6 Client Unbound interfaces :

这些提示会影响命令的输入,扰乱视线,可以先将其关闭,网络配通以后可以在打开。

# 关闭自动更新
root# delete chassis auto-image-upgrade

# 提交
[edit]
root# commit

# 恢复自动更新
root# set chassis auto-image-upgrade

2024-03-07
发表者 Venus
juniper关闭集群HA已关闭评论

juniper关闭集群HA

在开启了HA集群后,面板上的HA指示灯会亮绿色或者橙色。

# 注意是在命令行模式下
# 查看集群状态(HA)
root> show chassis cluster status

# 关闭集群并重启
root> set chassis cluster disable reboot

# 重启完成后再查看集群状态
root> show chassis cluster status
error: Chassis cluster is not enabled.

# 进入配置模式
root> configure
Entering configuration mode
[edit]

# 恢复出厂设置
root# load factory-default
warning: activating factory configuration

[edit]

# 设置root密码
root# set system root-authentication plain-text-password
New password:
Retype new password:

[edit]

# 提交
root# commit