You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB

13 years ago
  1. 1. each file can choose the replication factor
  2. 2. replication granularity is in volume level
  3. 3. if not enough spaces, we can automatically decrease some volume's the replication factor, especially for cold data
  4. 4. support migrating data to cheaper storage
  5. 5. manual volume placement, access-based volume placement, auction based volume placement
  6. When a new volume server is started, it reports
  7. 1. how many volumes it can hold
  8. 2. current list of existing volumes
  9. Each volume server remembers:
  10. 1. current volume ids, replica locations
  11. The master assign volume ids based on
  12. 1. replication factor
  13. data center, rack
  14. 2. concurrent write support
  15. On master, stores the replication configuration
  16. {
  17. replication:{
  18. {factor:1, min_volume_count:3, weight:10},
  19. {factor:2, min_volume_count:2, weight:20},
  20. {factor:3, min_volume_count:3, weight:30}
  21. },
  22. port:9333,
  23. }
  24. Or manually via command line
  25. 1. add volume with specified replication factor
  26. 2. add volume with specified volume id
  27. If duplicated volume ids are reported from different volume servers,
  28. the master determines the replication factor of the volume,
  29. if less than the replication factor, the volume is in readonly mode
  30. if more than the replication factor, the volume will purge the smallest/oldest volume
  31. if equal, the volume will function as usual
  32. maybe use gossip to send the volumeServer~volumes information
  33. Use cases:
  34. on volume server
  35. 1. weed volume -mserver="xx.xx.xx.xx:9333" -publicUrl="good.com:8080" -dir="/tmp" -volumes=50
  36. on weed master
  37. 1. weed master -port=9333
  38. generate a default json configuration file if doesn't exist
  39. Bootstrap
  40. 1. at the very beginning, the system has no volumes at all.
  41. 2. if maxReplicationFactor==1, always initialize volumes right away
  42. 3. if nServersHasFreeSpaces >= maxReplicationFactor, auto initialize
  43. 4. if maxReplicationFactor>1
  44. weed shell
  45. > disable_auto_initialize
  46. > enable_auto_initialize
  47. > assign_free_volume vid "server1:port","server2:port","server3:port"
  48. > status
  49. 5.