Clickhouse备份恢复_clickhouse-client方式backup_restore命令备份恢复的使用介绍

本文主要是介绍Clickhouse备份恢复_clickhouse-client方式backup_restore命令备份恢复的使用介绍,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Clickhouse备份恢复也可以使用clickhouse-client的backup和restore命令,参见https://clickhouse.com/docs/en/operations/backup#command-summary

clickhouse-client的backup命令备份出来的备份包的内容和开源工具clichouse-backup备份出来的备份包的内容类似,应该都是物理备份。clickhouse-client的backup命令备份出来的备份包,也可以拿到异机进行恢复,直接把备份包放到异机配置的system.disks备份目录下面后,再在异机下面直接执行restore database dbname from Disk(‘backupdirname’, ‘backupfilename’)命令就可以正常恢复了。oracle异机恢复如果异机和备份源机器目录一致的话可以顺利的按顺序执行restore spfile和restore controlfile和restore database,oracle异机恢复如果异机和备份源机器目录不一致则需要执行catalog backuppiece和newname for datafile 1 to ’ /datafile/system01.dbf’这种,但是clickhouse-client的异机恢复不需要像oracle一样执行catalog backuppiece。

备份实验
在服务器FStachDEV2上做备份

[root@FStachDEV2 ~]# mkdir /backups/
[root@FStachDEV2 ~]# chmod 766 /backups/
[root@FStachDEV2 ~]# vim /etc/clickhouse-server/config.d/backup_disk.xml
<clickhouse><storage_configuration><disks><backups><type>local</type><path>/backups/</path></backups></disks></storage_configuration><backups><allowed_disk>backups</allowed_disk><allowed_path>/backups/</allowed_path></backups>
</clickhouse>[root@FStachDEV2 ~]# systemctl restart clickhouse-server.service
[root@FStachDEV2 ~]# clickhouse-clientFStachDEV2 :) select name,path,type from system.disks;┌─name────┬─path─────────────────────┬─type──┐
1. │ backups │ /backups/Local2.default/chdata/clickhouse/data/Local │└─────────┴──────────────────────────┴───────┘FStachDEV2 :) create database lukestest1;FStachDEV2 :) CREATE TABLE lukestest1.table_mergetree (id String,create_time datetime) ENGINE = MergeTree() ORDER BY id;
FStachDEV2 :) insert into lukestest1.table_mergetree (id ,create_time) values ('1','2020-11-17'),('2','2020-11-17'),('3','2020-11-17'),('4','2020-11-17') ('5','2020-11-17'),('6','2020-11-17'),('7','2020-11-17'),('8','2020-11-17'),('9','2020-11-17'),('10','2020-11-17'),('11','2020-11-17'),('12','2020-11-17');FStachDEV2 :) CREATE TABLE lukestest1.table2_mergetree (id String,create_time datetime) ENGINE = MergeTree() ORDER BY id;
FStachDEV2 :) insert into lukestest1.table2_mergetree (id ,create_time) values ('1','2020-11-17'),('2','2020-11-17'),('3','2020-11-17'),('4','2020-11-17') ('5','2020-11-17'),('6','2020-11-17'),('7','2020-11-17'),('8','2020-11-17'),('9','2020-11-17'),('10','2020-11-17'),('11','2020-11-17'),('12','2020-11-17')FStachDEV2 :) backup database lukestest1 to Disk('backups', 'lukestest1.zip');┌─id───────────────────────────────────┬─status─────────┐
1. │ db2dba04-0b7a-473b-b88a-d8deee77b2cf │ BACKUP_CREATED │└──────────────────────────────────────┴────────────────┘FStachDEV2 :) SELECT id,name,base_backup_name,status,error,start_time,end_time FROM system.backups;┌─id───────────────────────────────────┬─name──────────────────────────────┬─base_backup_name─┬─status───┬─error─┬──────────start_time─┬────────────end_time─┐
1. │ d75ee6c1-8178-4e44-ae0c-6d64aeb79bb7 │ Disk('backups', 'lukestest1.zip') │                  │ RESTORED │       │ 2024-06-05 03:03:082024-06-05 03:03:08 │└──────────────────────────────────────┴───────────────────────────────────┴──────────────────┴──────────┴───────┴─────────────────────┴─────────────────────┘

解压备份包,查看备份目录和文件的信息

[root@FStachDEV2]# cd /backups/
[root@FStachDEV2 backups]# ll
-rw-r-----. 1 clickhouse clickhouse 4846 Jun  5 02:57 lukestest1.zip[root@FStachDEV2 backups]# unzip lukestest1.zip
Archive:  2.zipinflating: metadata/lukestest1.sqlinflating: metadata/lukestest1/table_mergetree.sqlinflating: metadata/lukestest1/table2_mergetree.sqlinflating: data/lukestest1/table2_mergetree/all_1_1_0/metadata_version.txtinflating: data/lukestest1/table2_mergetree/all_1_1_0/serialization.jsoninflating: data/lukestest1/table2_mergetree/all_1_1_0/default_compression_codec.txtinflating: data/lukestest1/table2_mergetree/all_1_1_0/count.txtinflating: data/lukestest1/table2_mergetree/all_1_1_0/columns.txtinflating: data/lukestest1/table2_mergetree/all_1_1_0/checksums.txtinflating: data/lukestest1/table2_mergetree/all_1_1_0/data.bininflating: data/lukestest1/table2_mergetree/all_1_1_0/data.cmrk3inflating: data/lukestest1/table2_mergetree/all_1_1_0/primary.cidxinflating: .backup[root@FStachDEV2 backups]# ll
drwxr-xr-x. 3 root       root         23 Jun  5 03:05 data
-rw-r-----. 1 clickhouse clickhouse 4846 Jun  5 02:57 lukestest1.zip
drwxr-xr-x. 3 root       root         44 Jun  5 03:05 metadata
[root@FStachDEV2 backups]# ll data
total 0
drwxr-xr-x. 3 root root 29 Jun  5 03:05 lukestest1
[root@FStachDEV2 backups]# ll data/lukestest1
total 0
drwxr-xr-x. 3 root root 22 Jun  5 03:05 table2_mergetree
[root@FStachDEV2 backups]# ll data/lukestest1/table2_mergetree
total 4
drwxr-xr-x. 2 root root 4096 Jun  5 03:05 all_1_1_0
[root@FStachDEV2 backups]# ll data/lukestest1/table2_mergetree/all_1_1_0
total 36
----------. 1 root root 259 Dec 31  1979 checksums.txt
----------. 1 root root  72 Dec 31  1979 columns.txt
----------. 1 root root   2 Dec 31  1979 count.txt
----------. 1 root root  93 Dec 31  1979 data.bin
----------. 1 root root  58 Dec 31  1979 data.cmrk3
----------. 1 root root  10 Dec 31  1979 default_compression_codec.txt
----------. 1 root root   1 Dec 31  1979 metadata_version.txt
----------. 1 root root  38 Dec 31  1979 primary.cidx
----------. 1 root root 158 Dec 31  1979 serialization.json
[root@FStachDEV2 backups]# ll metadata
total 4
drwxr-xr-x. 2 root root 59 Jun  5 03:05 lukestest1
----------. 1 root root 86 Dec 31  1979 lukestest1.sql
[root@FStachDEV2 backups]# ll metadata/lukestest1
total 8
----------. 1 root root 187 Dec 31  1979 table2_mergetree.sql
----------. 1 root root 186 Dec 31  1979 table_mergetree.sql

本机恢复实验,可以恢复
在服务器FStachDEV2上把数据库和表对应的文件改名,导致表无法查询,再恢复

FStachDEV2 :) select name,data_path,metadata_path from system.databases where name in ('lukestest1');┌─name───────┬─data_path──────────────────────┬─metadata_path───────────────────────────────────────────────────────────┐
1. │ lukestest1 │ /chdata/clickhouse/data/store//chdata/clickhouse/data/store/314/314036bc-c3de-4628-8f4b-435f9340da52/ │└────────────┴────────────────────────────────┴─────────────────────────────────────────────────────────────────────────┘FStachDEV2 :) select database,name,data_paths,metadata_path from system.tables where database in ('lukestest1') order by 1;┌─database───┬─name─────────────┬─data_paths──────────────────────────────────────────────────────────────────┬─metadata_path───────────────────────────────────────────────────────────────────────────────┐
1. │ lukestest1 │ table2_mergetree │ ['/chdata/clickhouse/data/store/858/858e6ec8-69f7-4a1b-852e-380f757939ca/']/chdata/clickhouse/data/store/314/314036bc-c3de-4628-8f4b-435f9340da52/table2_mergetree.sql2. │ lukestest1 │ table_mergetree  │ ['/chdata/clickhouse/data/store/667/66733022-fe6e-4753-9a11-9237f987f457/']/chdata/clickhouse/data/store/314/314036bc-c3de-4628-8f4b-435f9340da52/table_mergetree.sql  │└────────────┴──────────────────┴─────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────┘

进入数据库元数据目录/chdata/clickhouse/data/store/314/314036bc-c3de-4628-8f4b-435f9340da52/,把两表的元数据文件改名

[root@FStachDEV2 314]# cd  /chdata/clickhouse/data/store/314/314036bc-c3de-4628-8f4b-435f9340da52/
[root@FStachDEV2 314036bc-c3de-4628-8f4b-435f9340da52]# ll
total 8
-rw-r-----. 1 clickhouse clickhouse 172 Jun  5 02:50 table2_mergetree.sql
-rw-r-----. 1 clickhouse clickhouse 172 Jun  5 02:49 table_mergetree.sql
[root@FStachDEV2 314036bc-c3de-4628-8f4b-435f9340da52]# mv table2_mergetree.sql table2_mergetree.sql.bak
[root@FStachDEV2 314036bc-c3de-4628-8f4b-435f9340da52]# mv table_mergetree.sql table_mergetree.sql.bak

进入表table2_mergetree的目录/chdata/clickhouse/data/store/858,把表的数据目录改名

[root@FStachDEV2 314036bc-c3de-4628-8f4b-435f9340da52]# cd /chdata/clickhouse/data/store/858/858e6ec8-69f7-4a1b-852e-380f757939ca/
[root@FStachDEV2 858e6ec8-69f7-4a1b-852e-380f757939ca]# ll
drwxr-x---. 2 clickhouse clickhouse 4096 Jun  5 02:50 all_1_1_0
drwxr-x---. 2 clickhouse clickhouse    6 Jun  5 02:50 detached
-rw-r-----. 1 clickhouse clickhouse    1 Jun  5 02:50 format_version.txt
[root@FStachDEV2 858e6ec8-69f7-4a1b-852e-380f757939ca]# ll all_1_1_0
total 36
-rw-r-----. 1 clickhouse clickhouse 259 Jun  5 02:50 checksums.txt
-rw-r-----. 1 clickhouse clickhouse  72 Jun  5 02:50 columns.txt
-rw-r-----. 1 clickhouse clickhouse   2 Jun  5 02:50 count.txt
-rw-r-----. 1 clickhouse clickhouse  93 Jun  5 02:50 data.bin
-rw-r-----. 1 clickhouse clickhouse  58 Jun  5 02:50 data.cmrk3
-rw-r-----. 1 clickhouse clickhouse  10 Jun  5 02:50 default_compression_codec.txt
-rw-r-----. 1 clickhouse clickhouse   1 Jun  5 02:50 metadata_version.txt
-rw-r-----. 1 clickhouse clickhouse  38 Jun  5 02:50 primary.cidx
-rw-r-----. 1 clickhouse clickhouse 158 Jun  5 02:50 serialization.json
[root@FStachDEV2 858e6ec8-69f7-4a1b-852e-380f757939ca]# cd ..
[root@FStachDEV2 858]# mv 858e6ec8-69f7-4a1b-852e-380f757939ca 858e6ec8-69f7-4a1b-852e-380f757939ca.bak

进入表table_mergetree的目录/chdata/clickhouse/data/store/667,把表的数据目录改名

[root@FStachDEV2 858e6ec8-69f7-4a1b-852e-380f757939ca]# cd /chdata/clickhouse/data/store/667/66733022-fe6e-4753-9a11-9237f987f457
[root@FStachDEV2 66733022-fe6e-4753-9a11-9237f987f457]# ll
total 8
drwxr-x---. 2 clickhouse clickhouse 4096 Jun  5 02:50 all_1_1_0
drwxr-x---. 2 clickhouse clickhouse    6 Jun  5 02:49 detached
-rw-r-----. 1 clickhouse clickhouse    1 Jun  5 02:49 format_version.txt
[root@FStachDEV2 66733022-fe6e-4753-9a11-9237f987f457]# ll all_1_1_0/
total 36
-rw-r-----. 1 clickhouse clickhouse 259 Jun  5 02:50 checksums.txt
-rw-r-----. 1 clickhouse clickhouse  72 Jun  5 02:50 columns.txt
-rw-r-----. 1 clickhouse clickhouse   2 Jun  5 02:50 count.txt
-rw-r-----. 1 clickhouse clickhouse  93 Jun  5 02:50 data.bin
-rw-r-----. 1 clickhouse clickhouse  58 Jun  5 02:50 data.cmrk3
-rw-r-----. 1 clickhouse clickhouse  10 Jun  5 02:50 default_compression_codec.txt
-rw-r-----. 1 clickhouse clickhouse   1 Jun  5 02:50 metadata_version.txt
-rw-r-----. 1 clickhouse clickhouse  38 Jun  5 02:50 primary.cidx
-rw-r-----. 1 clickhouse clickhouse 158 Jun  5 02:50 serialization.json
[root@FStachDEV2 66733022-fe6e-4753-9a11-9237f987f457]# cd ..
[root@FStachDEV2 667]# mv 66733022-fe6e-4753-9a11-9237f987f457 66733022-fe6e-4753-9a11-9237f987f457.bak
[root@FStachDEV2 667]#[root@FStachDEV2 667]# systemctl start clickhouse-server
[root@FStachDEV2 667]# clickhouse-client
FStachDEV2 :) show databases;┌─name───────────────┐
1. │ INFORMATION_SCHEMA │
2.default3. │ information_schema │
4. │ lukestest1         │
5. │ system             │└────────────────────┘FStachDEV2 :) select *  from lukestest1.table2_mergetree;
Received exception from server (version 24.4.1):
Code: 60. DB::Exception: Received from localhost:9000. DB::Exception: Unknown table expression identifier 'lukestest1.table2_mergetree' in scope SELECT * FROM lukestest1.table2_mergetree. (UNKNOWN_TABLE)FStachDEV2 :) select *  from lukestest1.table_mergetree;
Elapsed: 0.001 sec.
Received exception from server (version 24.4.1):
Code: 60. DB::Exception: Received from localhost:9000. DB::Exception: Unknown table expression identifier 'lukestest1.table_mergetree' in scope SELECT * FROM lukestest1.table_mergetree. (UNKNOWN_TABLE)FStachDEV2 :) restore database lukestest1 from Disk('backups', 'lukestest1.zip');┌─id───────────────────────────────────┬─status───┐
1. │ d75ee6c1-8178-4e44-ae0c-6d64aeb79bb7 │ RESTORED │└──────────────────────────────────────┴──────────┘FStachDEV2 :) select *  from lukestest1.table_mergetree;┌─id─┬─────────create_time─┐1.12020-11-17 00:00:002.102020-11-17 00:00:003.112020-11-17 00:00:004.122020-11-17 00:00:005.22020-11-17 00:00:006.32020-11-17 00:00:007.42020-11-17 00:00:008.52020-11-17 00:00:009.62020-11-17 00:00:0010.72020-11-17 00:00:0011.82020-11-17 00:00:0012.92020-11-17 00:00:00 │└────┴─────────────────────┘FStachDEV2 :) select *  from lukestest1.table2_mergetree;┌─id─┬─────────create_time─┐1.12020-11-17 00:00:002.102020-11-17 00:00:003.112020-11-17 00:00:004.122020-11-17 00:00:005.22020-11-17 00:00:006.32020-11-17 00:00:007.42020-11-17 00:00:008.52020-11-17 00:00:009.62020-11-17 00:00:0010.72020-11-17 00:00:0011.82020-11-17 00:00:0012.92020-11-17 00:00:00 │└────┴─────────────────────┘

异机恢复实验,可以恢复
把服务器FStachDEV2的备份直接拷贝到服务器FStachDEV3就可以直接恢复(虽然拷贝到FStachDEV3后在FStachDEV3上查询system.backups没有结果,但是可以恢复)

root@FStachDEV3:~# mkdir /backups/
root@FStachDEV3:~# chmod 766 /backups/
root@FStachDEV3:~# cat /etc/clickhouse-server/config.d/backup_disk.xml
<clickhouse><storage_configuration><disks><backups><type>local</type><path>/backups/clickhouse/</path></backups></disks></storage_configuration><backups><allowed_disk>backups</allowed_disk><allowed_path>/backups/clickhousedir/</allowed_path></backups>
</clickhouse>root@FStachDEV3:~# systemctl restart clickhouse-server.serviceroot@FStachDEV3:~# clickhouse-client
FStachDEV3 :) select name,path,type from system.disks;┌─name────┬─path─────────────────┬─type──┐
1. │ backups │ /backups/clickhouse/Local2.default/var/lib/clickhouse/Local │└─────────┴──────────────────────┴───────┘FStachDEV3 :) select * from system.backups;
0 rows in set. Elapsed: 0.002 sec.
root@FStachDEV3:~# scp root@FStachDEV2:/backups/lukestest1.zip /backups/clickhouse/
root@FStachDEV3:~# clickhouse-client
FStachDEV3 :) select * from system.backups;
0 rows in set. Elapsed: 0.002 sec.FStachDEV3 :) show databases;┌─name───────────────┐
1. │ INFORMATION_SCHEMA │
2.default3. │ information_schema │
4. │ system             │└────────────────────┘FStachDEV3 :) restore database lukestest1 from Disk('backups','lukestest1.zip');┌─id───────────────────────────────────┬─status───┐
1.6a37bf36-e1a0-4b6f-8513-cd32865deec8 │ RESTORED │└──────────────────────────────────────┴──────────┘
FStachDEV3 :) show databases;┌─name───────────────┐
1. │ INFORMATION_SCHEMA │
2.default3. │ information_schema │
4. │ lukestest1         │
5. │ system             │└────────────────────┘FStachDEV3 :) use lukestest1;FStachDEV3 :) show tables;┌─name─────────────┐
1. │ table2_mergetree │
2. │ table_mergetree  │└──────────────────┘FStachDEV3 :) select * from table2_mergetree;┌─id─┬─────────create_time─┐1.12020-11-17 08:00:002.102020-11-17 08:00:003.112020-11-17 08:00:004.122020-11-17 08:00:005.22020-11-17 08:00:006.32020-11-17 08:00:007.42020-11-17 08:00:008.52020-11-17 08:00:009.62020-11-17 08:00:0010.72020-11-17 08:00:0011.82020-11-17 08:00:0012.92020-11-17 08:00:00 │└────┴─────────────────────┘FStachDEV3 :) select * from table_mergetree;┌─id─┬─────────create_time─┐1.12020-11-17 08:00:002.102020-11-17 08:00:003.112020-11-17 08:00:004.122020-11-17 08:00:005.22020-11-17 08:00:006.32020-11-17 08:00:007.42020-11-17 08:00:008.52020-11-17 08:00:009.62020-11-17 08:00:0010.72020-11-17 08:00:0011.82020-11-17 08:00:0012.92020-11-17 08:00:00 │└────┴─────────────────────┘

个人备份脚本(历史备份不会删除,所以代码里面需要加上一段删除30天之前的备份代码)

root@DDLACHDBDEV001:~# cat /root/script/clickhouse-client_backup.sh
#/bin/bash
backupdate=`date +%Y%m%d`
deletedate=`date -d '30 days ago' +%Y%m%d`echo `date`>>/root/clickhouse_backuplog/clickhouse_backup_$backupdate.log
echo "Begin to backup...">>/root/clickhouse_backuplog/clickhouse_backup_$backupdate.logclickhouse-client -h 127.0.0.1 -u default --password '123456' --port 9000 -q "backup database etl to Disk('backups','etl.zip');">>/root/clickhouse_backuplog/clickhouse_backup_$backupdate.log
clickhouse-client -h 127.0.0.1 -u default --password '123456' --port 9000 -q "backup database shared to Disk('backups','shared.zip');">>/root/clickhouse_backuplog/clickhouse_backup_$backupdate.logecho `date`>>/root/clickhouse_backuplog/clickhouse_backup_$backupdate.log
echo "Backup Completed!">>/root/clickhouse_backuplog/clickhouse_backup_$backupdate.logmkdir /mnt/datadomaindir/clickhouse_backup/Stage/ODSONESCRCHSTG1/$backupdatemv /var/lib/docker/volumes/root_clickhouse_backup/_data/etl.zip /mnt/datadomaindir/clickhouse_backup/Stage/ODSONESCRCHSTG1/$backupdate/etl.zip
mv /var/lib/docker/volumes/root_clickhouse_backup/_data/shared.zip /mnt/datadomaindir/clickhouse_backup/Stage/ODSONESCRCHSTG1/$backupdate/shared.ziprm -rf /mnt/datadomaindir/clickhouse_backup/Stage/ODSONESCRCHSTG1/$deletedate

这篇关于Clickhouse备份恢复_clickhouse-client方式backup_restore命令备份恢复的使用介绍的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1073228

相关文章

Linux使用fdisk进行磁盘的相关操作

《Linux使用fdisk进行磁盘的相关操作》fdisk命令是Linux中用于管理磁盘分区的强大文本实用程序,这篇文章主要为大家详细介绍了如何使用fdisk进行磁盘的相关操作,需要的可以了解下... 目录简介基本语法示例用法列出所有分区查看指定磁盘的区分管理指定的磁盘进入交互式模式创建一个新的分区删除一个存

C#使用HttpClient进行Post请求出现超时问题的解决及优化

《C#使用HttpClient进行Post请求出现超时问题的解决及优化》最近我的控制台程序发现有时候总是出现请求超时等问题,通常好几分钟最多只有3-4个请求,在使用apipost发现并发10个5分钟也... 目录优化结论单例HttpClient连接池耗尽和并发并发异步最终优化后优化结论我直接上优化结论吧,

SpringBoot使用Apache Tika检测敏感信息

《SpringBoot使用ApacheTika检测敏感信息》ApacheTika是一个功能强大的内容分析工具,它能够从多种文件格式中提取文本、元数据以及其他结构化信息,下面我们来看看如何使用Ap... 目录Tika 主要特性1. 多格式支持2. 自动文件类型检测3. 文本和元数据提取4. 支持 OCR(光学

JAVA系统中Spring Boot应用程序的配置文件application.yml使用详解

《JAVA系统中SpringBoot应用程序的配置文件application.yml使用详解》:本文主要介绍JAVA系统中SpringBoot应用程序的配置文件application.yml的... 目录文件路径文件内容解释1. Server 配置2. Spring 配置3. Logging 配置4. Ma

Python MySQL如何通过Binlog获取变更记录恢复数据

《PythonMySQL如何通过Binlog获取变更记录恢复数据》本文介绍了如何使用Python和pymysqlreplication库通过MySQL的二进制日志(Binlog)获取数据库的变更记录... 目录python mysql通过Binlog获取变更记录恢复数据1.安装pymysqlreplicat

Linux使用dd命令来复制和转换数据的操作方法

《Linux使用dd命令来复制和转换数据的操作方法》Linux中的dd命令是一个功能强大的数据复制和转换实用程序,它以较低级别运行,通常用于创建可启动的USB驱动器、克隆磁盘和生成随机数据等任务,本文... 目录简介功能和能力语法常用选项示例用法基础用法创建可启动www.chinasem.cn的 USB 驱动

C#使用yield关键字实现提升迭代性能与效率

《C#使用yield关键字实现提升迭代性能与效率》yield关键字在C#中简化了数据迭代的方式,实现了按需生成数据,自动维护迭代状态,本文主要来聊聊如何使用yield关键字实现提升迭代性能与效率,感兴... 目录前言传统迭代和yield迭代方式对比yield延迟加载按需获取数据yield break显式示迭

使用SQL语言查询多个Excel表格的操作方法

《使用SQL语言查询多个Excel表格的操作方法》本文介绍了如何使用SQL语言查询多个Excel表格,通过将所有Excel表格放入一个.xlsx文件中,并使用pandas和pandasql库进行读取和... 目录如何用SQL语言查询多个Excel表格如何使用sql查询excel内容1. 简介2. 实现思路3

java脚本使用不同版本jdk的说明介绍

《java脚本使用不同版本jdk的说明介绍》本文介绍了在Java中执行JavaScript脚本的几种方式,包括使用ScriptEngine、Nashorn和GraalVM,ScriptEngine适用... 目录Java脚本使用不同版本jdk的说明1.使用ScriptEngine执行javascript2.

c# checked和unchecked关键字的使用

《c#checked和unchecked关键字的使用》C#中的checked关键字用于启用整数运算的溢出检查,可以捕获并抛出System.OverflowException异常,而unchecked... 目录在 C# 中,checked 关键字用于启用整数运算的溢出检查。默认情况下,C# 的整数运算不会自