373 lines
5.8 KiB
Markdown
Executable File
373 lines
5.8 KiB
Markdown
Executable File
|
||
|
||
## 一、远程桌面
|
||
|
||
### Office Windows Desktop
|
||
|
||
- **TeamViewer 设备号**
|
||
|
||
```
|
||
299 885 389
|
||
```
|
||
|
||
- **密码**
|
||
|
||
```
|
||
Admingzzn@1
|
||
```
|
||
|
||
|
||
|
||
### VM Windows 10
|
||
|
||
- **rdesk**
|
||
|
||
```
|
||
1 269 698 093
|
||
```
|
||
|
||
|
||
```
|
||
a4pvYPW2YO3aER
|
||
```
|
||
|
||
todesk
|
||
|
||
```
|
||
487 821 301
|
||
|
||
```
|
||
|
||
|
||
```
|
||
a4pvYPW2YO3aER=
|
||
```
|
||
|
||
|
||
|
||
|
||
|
||
### GZZN Opensuse Desktop
|
||
|
||
rustdesk
|
||
```
|
||
1135993583
|
||
```
|
||
|
||
```
|
||
4ZZzxrAfwFj5q1
|
||
```
|
||
|
||
rustdesk 中继密码
|
||
```
|
||
4BWKesxFCiKVPj7j6Zm7qV4JW8FtvRXZY1Zejv4nGxk=
|
||
```
|
||
|
||
|
||
|
||
## 二、服务器信息
|
||
|
||
### 服务器密码
|
||
|
||
```
|
||
8VLtg#ZYA@AJSFJcPM
|
||
```
|
||
|
||
### 服务器使用
|
||
|
||
- 主机:103
|
||
|
||
- 调整内存:100GB
|
||
|
||
|
||
---
|
||
|
||
## 三、二期资源
|
||
|
||
### 主机 10.194.62.26
|
||
|
||
```
|
||
Gzzwy@%2020$
|
||
```
|
||
|
||
### 内存百分比脚本
|
||
|
||
```bash
|
||
#!/bin/bash
|
||
free -h
|
||
echo "内存使用百分比: $(free | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')"
|
||
```
|
||
|
||
---
|
||
|
||
## 四、工具与探针
|
||
|
||
### 工具下载
|
||
|
||
```bash
|
||
curl -k http://10.205.205.26:9092/tools/sh | bash
|
||
```
|
||
|
||
### 探针安装
|
||
|
||
```bash
|
||
curl -k https://10.207.33.1:9000/up-install/up-install.sh | bash -x
|
||
```
|
||
|
||
### 安装失败节点
|
||
|
||
- 10.209.42.14
|
||
|
||
- 10.209.42.15
|
||
|
||
- 10.209.42.18
|
||
|
||
- 10.209.42.20
|
||
|
||
- 10.209.42.21
|
||
|
||
- 10.209.42.22
|
||
|
||
|
||
### 探针测试
|
||
|
||
```bash
|
||
nc -uvz 10.207.33.1 12201
|
||
systemctl status uniprobe
|
||
```
|
||
|
||
### 手动运行探针
|
||
|
||
```bash
|
||
bash -x /usr/local/bin/uniprobe-worker.sh -n 10.207.33.1:9000 \
|
||
-a 1qgmg9koe1v2s998jsceikklontia2v9nact3gumfk6mkcd02251 \
|
||
> /tmp/uniprobe/test.txt 2>&1
|
||
```
|
||
|
||
上传日志:
|
||
|
||
```bash
|
||
rz /tmp/uniprobe/test.txt
|
||
```
|
||
|
||
### 抓包验证
|
||
|
||
```bash
|
||
tcpdump -i any port 12201 -w a.pcap
|
||
```
|
||
|
||
---
|
||
|
||
## 五、数据迁移生产环境
|
||
|
||
### 1. MinIO 迁移
|
||
|
||
- 迁移桶:**fgw-law**
|
||
|
||
- URL: `http://130.120.3.126:9000`
|
||
|
||
- key: `GZZNEXAMPLE`
|
||
|
||
- secret: `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
|
||
|
||
- bucketName: `fgw-law`
|
||
|
||
|
||
MinIO 客户端配置:
|
||
|
||
```bash
|
||
mc alias set src http://130.120.3.126:9000 GZZNEXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
|
||
```
|
||
|
||
---
|
||
|
||
### 2. Elasticsearch 迁移
|
||
|
||
- 索引:**fgw_law_file_index**
|
||
|
||
- uris: `10.100.100.187:9200,10.100.100.188:9200,10.100.100.189:9200`
|
||
|
||
- 用户名: `elastic`
|
||
|
||
- 密码: `yjj@2022EmS,12`
|
||
|
||
|
||
#### elasticdump 工具
|
||
|
||
```bash
|
||
docker pull elasticdump/elasticsearch-dump
|
||
```
|
||
|
||
**导出 Mapping**
|
||
|
||
```bash
|
||
docker run --rm --network host -v "$PWD:/dump" elasticdump/elasticsearch-dump \
|
||
--input=http://elastic:yjj%402022EmS%2C12@localhost:9200/my_index \
|
||
--output=/dump/my_index_mapping.json \
|
||
--type=mapping --debug
|
||
```
|
||
|
||
**导出 Mapping + Data**
|
||
|
||
```bash
|
||
# Mapping
|
||
sudo docker run --rm --network host \
|
||
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
|
||
-v "$PWD:/dump" elasticdump/elasticsearch-dump \
|
||
--input="https://elastic:yjj%402022EmS%2C12@127.0.0.1:9200/fgw_law_file_index" \
|
||
--output="/dump/fgw_law_file_index_mapping.json" \
|
||
--type=mapping --timeout=300000
|
||
|
||
# Data
|
||
sudo docker run --rm --network host \
|
||
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
|
||
-v "$PWD:/dump" elasticdump/elasticsearch-dump \
|
||
--input="https://elastic:yjj%402022EmS%2C12@127.0.0.1:9200/fgw_law_file_index" \
|
||
--output="/dump/fgw_law_file_index_data.json" \
|
||
--type=data --limit=2000 --concurrency=4 --fileSize=100mb --timeout=300000
|
||
```
|
||
|
||
#### Snapshot 方式
|
||
|
||
**注册仓库**
|
||
|
||
```bash
|
||
curl -s -H 'Content-Type: application/json' \
|
||
-X PUT 'http://127.0.0.1:8200/_snapshot/local_backup' \
|
||
-d '{"type":"fs","settings":{"location":"/snapshots","compress":true}}'
|
||
```
|
||
|
||
**创建快照**
|
||
|
||
```bash
|
||
curl -s -H 'Content-Type: application/json' \
|
||
-X PUT 'http://127.0.0.1:8200/_snapshot/local_backup/fgw_2025_09_03?wait_for_completion=true' \
|
||
-d '{
|
||
"indices": "fgw_law_file_index",
|
||
"ignore_unavailable": true,
|
||
"include_global_state": false
|
||
}'
|
||
```
|
||
|
||
**校验快照**
|
||
|
||
```bash
|
||
curl -s 'http://127.0.0.1:8200/_snapshot/local_backup/fgw_2025_09_03?pretty'
|
||
```
|
||
|
||
**打包快照**
|
||
|
||
```bash
|
||
tar czf /opt/elastic/fgw_law_snapshot_2025-09-03.tgz -C /opt/elastic/snapshots .
|
||
```
|
||
|
||
**恢复(相同索引名)**
|
||
|
||
```bash
|
||
curl -s -H 'Content-Type: application/json' \
|
||
-X POST 'http://127.0.0.1:8200/_snapshot/local_backup/fgw_2025_09_03/_restore' \
|
||
-d '{
|
||
"indices": "fgw_law_file_index",
|
||
"include_global_state": false
|
||
}'
|
||
```
|
||
|
||
**恢复(新索引名)**
|
||
|
||
```bash
|
||
curl -s -H 'Content-Type: application/json' \
|
||
-X POST 'http://127.0.0.1:8200/_snapshot/local_backup/fgw_2025_09_03/_restore' \
|
||
-d '{
|
||
"indices": "fgw_law_file_index",
|
||
"rename_pattern": "fgw_law_file_index",
|
||
"rename_replacement": "fgw_law_file_index_restored",
|
||
"include_global_state": false
|
||
}'
|
||
```
|
||
|
||
---
|
||
|
||
### 3. MongoDB 迁移
|
||
|
||
- 数据库:**fgw_v3**
|
||
|
||
- host: `10.100.101.101`
|
||
|
||
- 用户名: `fgw_v3`
|
||
|
||
- 密码: `Fgw@2024`
|
||
|
||
- 端口: `27017`
|
||
|
||
|
||
**导出**
|
||
|
||
```bash
|
||
/opt/mongodb/mongodb-database-tools-100.9.4/bin/mongodump \
|
||
--host 10.100.101.101 --port 27017 \
|
||
-u 'fgw_v3' -p 'Fgw@2024' \
|
||
--db fgw_v3 \
|
||
--authenticationDatabase fgw_v3 \
|
||
--authenticationMechanism SCRAM-SHA-256 \
|
||
--archive=/opt/mongodb/export/fgw_v3_$(date +%F).archive.gz \
|
||
--gzip
|
||
```
|
||
|
||
**另一种导出方式**
|
||
|
||
```bash
|
||
sudo mongodb-database-tools-100.9.4/bin/mongodump -u fgw_v3 -p Fgw@2024 -h localhost \
|
||
--db fgw_v3 --archive=fgw_v3-$(date +%F).gz --gzip
|
||
```
|
||
|
||
**导入**
|
||
|
||
```bash
|
||
/data/soft/mongodb-database-tools-100.9.4/bin/mongorestore \
|
||
--host localhost --port 27017 \
|
||
-u 'fgw_v3' -p 'FgwV3@202403' \
|
||
--authenticationDatabase fgw_v3 \
|
||
--authenticationMechanism SCRAM-SHA-256 \
|
||
--archive=/data/tmp/fgw_v3.archive.gz --gzip
|
||
```
|
||
|
||
---
|
||
|
||
|
||
|
||
10.209.42.20 mongo
|
||
|
||
```
|
||
VOLUME_DB=$(docker inspect mongodb | jq -r '.[0].Mounts[] | select(.Destination=="/data/db") | .Source')
|
||
echo $VOLUME_DB
|
||
ls -l $VOLUME_DB
|
||
|
||
```
|
||
|
||
|
||
|
||
更新监控软件
|
||
```bash
|
||
curl -k http://10.205.205.26:9092/tools/sh | bash
|
||
```
|
||
|
||
```bash
|
||
systemctl status pp-monitor
|
||
```
|
||
|
||
|
||
|
||
|
||
服务器移交:
|
||
10.209.42.19 (zookeeper)
|
||
新密码:
|
||
|
||
```
|
||
uve|ph7ro9bieCh#
|
||
```
|
||
|
||
|
||
```
|
||
echo -e 'uve|ph7ro9bieCh#\nuve|ph7ro9bieCh#' | passwd
|
||
```
|