当前位置:网站首页>Fastdfs data migration operation record
Fastdfs data migration operation record
2022-07-07 00:58:00 【404 Eason Chan】
Migration scenario :
Because the online server is changed from Alibaba cloud to Baidu cloud , Online migration is required , It includes the migration of image files , The file system of the company uses fdfs
Server configuration
Environmental Science | IP |
---|---|
Alibaba cloud environment ( used ) | ali Public network |
Baidu cloud environment ( new ) | baidu Public network |
Operation process
-----------
Check out the fdfs Operating state
[[email protected] ~]# ps -ef|grep fdfs
root 12719 1 0 01:25 ? 00:00:00 fdfs_trackerd /etc/fdfs/tracker.conf start
root 12917 1 51 01:29 ? 00:00:01 fdfs_storaged /etc/fdfs/storage.conf start
root 12927 12404 0 01:29 pts/1 00:00:00 grep --color=auto fdfs
Check out the store Catalog
[[email protected] ~]# ll /home/youxin/config/fastdfs/storage/store/data/00/00/
total 0
# You can see that there are no files in this directory at present
Stop the new environment storage process
[[email protected] ~]# fdfs_storaged /etc/fdfs/storage.conf stop
waiting for pid [12917] exit ...
pid [12917] exit.
[[email protected] ~]# ps -ef|grep fdfs
root 12719 1 0 01:25 ? 00:00:00 fdfs_trackerd /etc/fdfs/tracker.conf start
root 12986 12404 0 01:32 pts/1 00:00:00 grep --color=auto fdfs
Modify the new environment storage.conf file , take tracker_serve Medium ip The address is in the old environment ip
[[email protected] ~]# cat /etc/fdfs/storage.conf|grep tracker_server
# tracker_server can ocur more than once, and tracker_server format is
#tracker_server= New environment ip:22122
tracker_server= Old environment ip:22122
Here we need to pay attention to
Be careful storage.conf In file ,group_name、store_path_count It should be consistent with the old environment storage.conf Documents are consistent ;
[[email protected] ~]# cat /etc/fdfs/storage.conf|grep 'group_name\|store_path_count'
group_name=group1
store_path_count=2
# This is the configuration of the old environment
# Before the new environment is modified
[[email protected] ~]# cat /etc/fdfs/storage.conf|grep 'group_name\|store_path_count'
group_name=group1
store_path_count=1
# After the new environment is modified
[[email protected] ~]# cat /etc/fdfs/storage.conf|grep 'group_name\|store_path_count'
group_name=group1
store_path_count=2
If your old environment store_path_count If there is more than one, you need to create the corresponding storage directory , Otherwise, the next startup will report an error
store_path_count=2
# store_path#, based 0, if store_path0 not exists, it's value is base_path
# the paths must be exist
store_path0=/home/youxin/config//fastdfs/storage/store
store_path1=/home/youxin/config//fastdfs/storage2/store
Finally, start the new environment storage, At this time , Old server tracker It will go to the new server storage Synchronous data
[[email protected] ~]# fdfs_storaged /etc/fdfs/storage.conf start
[[email protected] ~]# ps -ef|grep fdfs
root 12719 1 0 01:25 ? 00:00:00 fdfs_trackerd /etc/fdfs/tracker.conf start
root 13185 1 31 01:47 ? 00:00:01 fdfs_storaged /etc/fdfs/storage.conf start
root 13201 12404 0 01:47 pts/1 00:00:00 grep --color=auto fdfs
adopt fdfs_monitor /etc/fdfs/storage.conf Check the corresponding storage Is the status yes active
# FDFS_STORAGE_STATUS:INIT : initialization , The source server that has not been synchronized with the existing data
# FDFS_STORAGE_STATUS:WAIT_SYNC : Waiting for synchronization , The source server that has synchronized the existing data
# FDFS_STORAGE_STATUS:SYNCING : Syncing
# FDFS_STORAGE_STATUS:DELETED : deleted , This server is removed from this group
# FDFS_STORAGE_STATUS:OFFLINE : offline
# FDFS_STORAGE_STATUS:ONLINE : On-line , Not yet able to provide services
# FDFS_STORAGE_STATUS:ACTIVE : On-line , Can provide services
Finally, check whether the new environment directory files are synchronized
[[email protected] ~]# ll /home/youxin/config/fastdfs/storage/store/data/00/00/
total 79984
-rw-r--r-- 1 root root 78258 Aug 23 2021 rB3kk2EjZtKAIlCWAAExsrbSCWM679.jpg
-rw-r--r-- 1 root root 55960 Aug 26 2021 rB3kk2EnapmAed5JAADamCemQ4Q843.png
-rw-r--r-- 1 root root 23527 Aug 26 2021 rB3kk2Enb_GARWUmAABb51Yzqbw61.jpeg
-rw-r--r-- 1 root root 91 Aug 26 2021 rB3kk2Enc-2AH88hAAAAW-pqB00981.jpg
-rw-r--r-- 1 root root 24695 Aug 26 2021 rB3kk2Enc2GAfzSSAABgdybmZVM109.jpg
-rw-r--r-- 1 root root 7352 Aug 26 2021 rB3kk2Enc3uACf49AAAcuM2IpaM836.png
-rw-r--r-- 1 root root 7352 Aug 26 2021 rB3kk2Enc4KAeonMAAAcuM2IpaM298.png
-rw-r--r-- 1 root root 7352 Aug 26 2021 rB3kk2Enc8WAJDXrAAAcuM2IpaM229.png
-rw-r--r-- 1 root root 7352 Aug 26 2021 rB3kk2EncMqASN6EAAAcuM2IpaM596.png
-rw-r--r-- 1 root root 7352 Aug 26 2021 rB3kk2EncQyAZJ-6AAAcuM2IpaM536.png
-rw-r--r-- 1 root root 7352 Aug 26 2021 rB3kk2Encu2AaGD_AAAcuM2IpaM304.png
-rw-r--r-- 1 root root 7352 Aug 26 2021 rB3kk2EncyCAJY8wAAAcuM2IpaM214.png
Finally, don't forget to put tracker_server Of IP Change the address back to the new IP
We need to pay attention to :
1. Communication between the old and new environments must be ensured ( That is, public network to public network Intranet to intranet )
2. Relevant firewall ports need to be released
3. New environment group_name、store_path_count It should be consistent with the old environment storage.conf Documents are consistent ( must ), Otherwise, it can't be synchronized
If you have any other questions, please leave a message in the comment area to discuss ~~~~
边栏推荐
- Advanced learning of MySQL -- basics -- multi table query -- external connection
- Cross-entrpy Method
- Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
- Periodic flash screen failure of Dell notebook
- Use mujoco to simulate Cassie robot
- Markov decision process
- Telerik UI 2022 R2 SP1 Retail-Not Crack
- 新手如何入门学习PostgreSQL?
- Learn self 3D representation like ray tracing ego3rt
- 建立自己的网站(17)
猜你喜欢
城联优品入股浩柏国际进军国际资本市场,已完成第一步
[Batch dos - cmd Command - Summary and Summary] - String search, find, Filter Commands (FIND, findstr), differentiation and Analysis of Find and findstr
Service asynchronous communication
Memory optimization of Amazon memorydb for redis and Amazon elasticache for redis
Stm32f407 ------- SPI communication
Chapter II proxy and cookies of urllib Library
第七篇,STM32串口通信编程
Configuring OSPF basic functions for Huawei devices
深度学习之线性代数
Installation and testing of pyflink
随机推荐
QT tutorial: creating the first QT program
threejs图片变形放大全屏动画js特效
Explain in detail the matrix normalization function normalize() of OpenCV [norm or value range of the scoped matrix (normalization)], and attach norm_ Example code in the case of minmax
Dell Notebook Periodic Flash Screen Fault
OSPF configuration command of Huawei equipment
Attention slam: a visual monocular slam that learns from human attention
dynamic programming
C Primer Plus Chapter 14 (structure and other data forms)
5种不同的代码相似性检测,以及代码相似性检测的发展趋势
在jupyter中实现实时协同是一种什么体验
JS+SVG爱心扩散动画js特效
Explain in detail the implementation of call, apply and bind in JS (source code implementation)
[yolov5 6.0 | 6.1 deploy tensorrt to torch serve] environment construction | model transformation | engine model deployment (detailed packet file writing method)
Activereportsjs 3.1 Chinese version | | | activereportsjs 3.1 English version
详解OpenCV的矩阵规范化函数normalize()【范围化矩阵的范数或值范围(归一化处理)】,并附NORM_MINMAX情况下的示例代码
【JokerのZYNQ7020】AXI_EMC。
Link sharing of STM32 development materials
浅谈测试开发怎么入门,如何提升?
Deeply explore the compilation and pile insertion technology (IV. ASM exploration)
Advanced learning of MySQL -- basics -- multi table query -- subquery