当前位置:网站首页>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 ~~~~
边栏推荐
- [C language] dynamic address book
- Learn self 3D representation like ray tracing ego3rt
- View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
- Chenglian premium products has completed the first step to enter the international capital market by taking shares in halber international
- STM32开发资料链接分享
- Three methods to realize JS asynchronous loading
- 英雄联盟|王者|穿越火线 bgm AI配乐大赛分享
- Mongodb client operation (mongorepository)
- Advantages and disadvantages of code cloning
- stm32F407-------SPI通信
猜你喜欢
equals()与hashCode()
threejs图片变形放大全屏动画js特效
学习使用代码生成美观的接口文档!!!
AI super clear repair resurfaces the light in Huang Jiaju's eyes, Lecun boss's "deep learning" course survival report, beautiful paintings only need one line of code, AI's latest paper | showmeai info
Attention slam: a visual monocular slam that learns from human attention
C9 colleges and universities, doctoral students make a statement of nature!
集合(泛型 & List & Set & 自定义排序)
「精致店主理人」青年创业孵化营·首期顺德场圆满结束!
深入探索编译插桩技术(四、ASM 探秘)
Data processing of deep learning
随机推荐
pyflink的安装和测试
什么是时间
[Batch dos - cmd Command - Summary and Summary] - String search, find, Filter Commands (FIND, findstr), differentiation and Analysis of Find and findstr
第六篇,STM32脉冲宽度调制(PWM)编程
【批处理DOS-CMD命令-汇总和小结】-字符串搜索、查找、筛选命令(find、findstr),Find和findstr的区别和辨析
ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
Attention SLAM:一種從人類注意中學習的視覺單目SLAM
Slow database query optimization
String comparison in batch file - string comparison in batch file
Batch obtain the latitude coordinates of all administrative regions in China (to the county level)
Return to blowing marshland -- travel notes of zhailidong, founder of duanzhitang
重上吹麻滩——段芝堂创始人翟立冬游记
Alexnet experiment encounters: loss Nan, train ACC 0.100, test ACC 0.100
Part V: STM32 system timer and general timer programming
【批处理DOS-CMD命令-汇总和小结】-查看或修改文件属性(ATTRIB),查看、修改文件关联类型(assoc、ftype)
mongodb客户端操作(MongoRepository)
Model-Free Control
Learn self 3D representation like ray tracing ego3rt
随时随地查看远程试验数据与记录——IPEhub2与IPEmotion APP
学习光线跟踪一样的自3D表征Ego3RT