In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to achieve server backup and data import and export". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn the article "how to achieve server backup and data import and export".
Settings related to server backup
O2OA can backup the data and files automatically. After the server is configured, the system will back up the data and files in the server according to the specified time period, which can effectively avoid the data loss caused by the misoperation of the data in the server.
Configuration file path: o2server/config/node_127.0.0.1.json
{
"enable": true
"port": null
"sslEnable": false
"logLevel": "info"
"isPrimaryCenter": true
"nodeAgentEnable": true
"application": {
"enable": true
"port": null
"sslEnable": false
"proxyHost":
"proxyPort": null
"forceRedeploy": true
"scanInterval": 5
"includes": []
"excludes": []
}
"web": {
"enable": true
"port": 80
"sslEnable": false
"proxyHost":
"proxyPort": 80
"forceRedeploy": true
}
"storage": {
"enable": true
"port": null
"sslEnable": false
"name":
}
"data": {
"enable": true
"tcpPort": null
"webPort": null
"includes": []
"excludes": []
}
/ / Database export backup related configuration
"dumpData": {
"cron": "0 021 * *?", / / time period for database export backup execution, Cron expression
"size": 14 / / maximum number of backup files retained for database export
}
/ / File export backup related configuration
"dumpStorage": {
"cron": "0 021 * *?", / / the time period during which the file storage export backup is performed, Cron expression
"size": 14 / / maximum number of backup files retained for file storage export
}
}
Backup file location: o2server\ local\ backup
Configuration instructions:
1. The parameter cron:O2OA uses the general CRON time expression to set the task execution cycle.
Common CRON expressions:
(1) 0 021 *? * indicates that the task is adjusted at 2 am on the 1st of each month.
(2) 0 15 10? * MON-FRI says that homework is performed at 10:15 every day from Monday to Friday.
(3) 0 15 10? 6L 2002-2006 means that the last Friday of every month from 2002 to 2006 will be executed at 10:15
(4) 0 010, 14, 14, 16? 10:00, 2pm, 4pm every day
(5) 00 stroke 30 9-17 *? Every half hour during working hours from nine to five
(6) 0 012? * WED means 12:00 every Wednesday
(7) 0 012 *? Triggered at 12:00 every day
(8) 0 15 10? * triggered at 10:15 every morning
(9) 0 15 10 *? Triggered at 10:15 every morning
(10) 0 15 10 *? * triggered at 10:15 every morning
(11) 0 15 10 * *? trigger at 10:15 every morning in 2005
(12) 0 * 14 * *? Triggered every minute between 2pm and 2:59 every day
(13) 0 0 stroke 5 14 * *? Triggered every 5 minutes between 2pm and 2:55 every day
(14) 0 00 stroke 5 14 1 18 * *? Triggered every 5 minutes between 2pm and 2:55 and between 6pm and 6:55 every day
(15) 00-5 14 *? Triggered every minute between 2pm and 2:05 every day
(16) 0 10 WED 44 14? 3 trigger at 2:10 and 2:44 on Wednesday in March every year
(17) 0 15 10? * MON-FRI triggers at 10:15 from Monday to Friday
(18) 0 15 10 15 *? Triggered at 10:15 on the 15th of each month
(19) 0 15 10 L *? Triggered at 10:15 on the last day of each month
(20) 0 15 10? * 6L triggered at 10:15 on the last Friday of each month
(21) 0 15 10? * 6L 2002-2005 trigger at 10:15 on the last Friday of each month from 2002 to 2005
(22) 0 15 10? * 6: 3 trigger at 10:15 on the third Friday of each month
2. Parameter size: because considering the summer effect of backup on disk capacity, O2OA supports retaining only a specified number of backup files. When the number of backup files exceeds the number specified by size, the earliest backup files will be deleted.
Commands for data export and data import
1. Data export command: dump data
In addition to automatic backup, O2OA also supports manual export of all data in the server database.
Operating procedures in the Winodws operating system (similar in other operating systems):
1) execute o2server/start_windows.bat
2) start the built-in database (note: if you are using external data, make sure that the data has been started properly and can be connected by o2server)
Execute the command: start data. After startup, it is shown in the following figure:
3) Export data
Execute the command: dump data O2 (description: O2 is the default administrator password for the server). The execution effect is as follows:
When the export is complete, it displays:
2018-10-1610: 20:18 PRINT [main] com.x.server.console.action.ActionDumpData-dump data completed, directory: d:\ o2server\ local\ dump\ dumpData_20181016101732, count: 56144, elapsed: 2 minutes.
The information indicates the path where the exported data file is stored, the amount of data exported and the time consumed by the export process:
The path where the exported data file is stored: directory: d:\ o2server\ local\ dump\ dumpData_20181016101732
Amount of data exported: count: 56144
Time spent in the export process: elapsed: 2 minutes.
As shown in the following figure:
Location of the exported file:
2. Import the existing backup data file, command: restore data
Operating procedures in the Winodws operating system (similar in other operating systems):
1) execute o2server/start_windows.bat
2) start the built-in database (note: if you are using external data, make sure that the data has been started properly and can be connected by o2server)
Execute the command: start data. After startup, it is shown in the following figure:
3) restore data
Before restoring data, you need to make sure that the data files that need to be recovered already exist and are placed in the o2server\ local\ dump directory, and that the folder is named as dumpData_, such as dumpData_20181016101732, and the time stamp 20181016101732 will be used in the import command.
Execute the command: restore data 20181016101732 o2 (description: O2 is the default administrator password for the server and 20181016101732 is the time stamp of the exported file). The execution effect is as follows:
The picture above shows that the O2OA system is performing a data recovery process. Please note that if there is data in the original database, the original data will be erased. After the data recovery process is completed, as shown in the following figure:
"when the restore is complete, it displays:"
2018-10-16 10:42:01 PRINT [main] com.x.server.console.action.ActionRestoreData-restore data completed, total count: 56144, elapsed: 3 minutes.
The amount of data recovered and the time consumed by the recovery process are indicated in the information:
Amount of data exported: count: 56144
Time spent in the export process: elapsed: 3 minutes.
After the file recovery is complete, type start directly to start the server normally.
File storage export and file storage import commands
1. The process of file storage, export and import is similar to the process of data export and import, which will not be discussed in this article.
2. File storage, export and import can also be carried out by copying and pasting the file directory.
The above is all the contents of the article "how to achieve server backup and data import and export". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.