手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

在Ubuntu Server 11.10下部署SWIFT存储和Swauth认证

[日期:2012-04-03] 来源:Linux社区  作者:cywosp [字体:大 中 小]

8.  设置rsync

  1. sudo touch /etc/rsyncd.conf    #在/etc/下创建rsyncd.conf  
  2. sudo chmod a+w /etc/rsyncd.conf  
  3.    
  4. 将以下配置信息写入/etc/rsyncd.conf中  
  5. uid =swift  
  6. gid =swift  
  7. logfile = /var/log/rsyncd.log  
  8. pidfile = /var/run/rsyncd.pid  
  9. address= 127.0.0.1  
  10.    
  11. [account6012]  
  12. maxconnections = 25  
  13. path =/srv/1/node/  
  14. readonly = false  
  15. lockfile = /var/lock/account6012.lock  
  16.    
  17. [account6022]  
  18. maxconnections = 25  
  19. path =/srv/2/node/  
  20. readonly = false  
  21. lockfile = /var/lock/account6022.lock  
  22.    
  23. [account6032]  
  24. maxconnections = 25  
  25. path =/srv/3/node/  
  26. readonly = false  
  27. lockfile = /var/lock/account6032.lock  
  28.    
  29. [account6042]  
  30. maxconnections = 25  
  31. path =/srv/4/node/  
  32. readonly = false  
  33. lockfile = /var/lock/account6042.lock  
  34.    
  35. [container6011]  
  36. maxconnections = 25  
  37. path =/srv/1/node/  
  38. readonly = false  
  39. lockfile = /var/lock/container6011.lock  
  40.    
  41. [container6021]  
  42. maxconnections = 25  
  43. path =/srv/2/node/  
  44. readonly = false  
  45. lockfile = /var/lock/container6021.lock  
  46.    
  47. [container6031]  
  48. maxconnections = 25  
  49. path =/srv/3/node/  
  50. readonly = false  
  51. lockfile = /var/lock/container6031.lock  
  52.    
  53. [container6041]  
  54. maxconnections = 25  
  55. path =/srv/4/node/  
  56. readonly = false  
  57. lockfile = /var/lock/container6041.lock  
  58.    
  59. [object6010]  
  60. maxconnections = 25  
  61. path =/srv/1/node/  
  62. readonly = false  
  63. lockfile = /var/lock/object6010.lock  
  64.    
  65. [object6020]  
  66. maxconnections = 25  
  67. path =/srv/2/node/  
  68. readonly = false  
  69. lockfile = /var/lock/object6020.lock  
  70.    
  71. [object6030]  
  72. maxconnections = 25  
  73. path =/srv/3/node/  
  74. readonly = false  
  75. lockfile = /var/lock/object6030.lock  
  76.    
  77. [object6040]  
  78. maxconnections = 25  
  79. path =/srv/4/node/  
  80. readonly = false  
  81. lockfile = /var/lock/object6040.lock  
  82.    
  83. 编辑/etc/default/rsync:  
  84. 将RSYNC_ENABLE设置为true  
  85.    
  86. 重启服务:  
  87. sudo servicersync restart  

9.  设置日志文件(可选)

  1. sudo touch /etc/rsyslog.d/10-swift.conf  
  2. sudo chmod a+w /etc/rsyslog.d/10-swift.conf  
  1. 在该文件中添加如下配置信息  
  2. #Uncomment the following to have a log containing all logs together  
  3. #local1,local2,local3,local4,local5.*   /var/log/swift/all.log  
  4. #Uncomment the following to have hourly proxy logs for stats processing  
  5. #$templateHourlyProxyLog,"/var/log/swift/hourly/%$YEAR%%$MONTH%%$DAY%%$HOUR%"  
  6. #local1.*;local1.!notice?HourlyProxyLog  
  7.    
  8. local1.*;local1.!notice/var/log/swift/proxy.log  
  9. local1.notice           /var/log/swift/proxy.error  
  10. local1.*                ~  
  11.    
  12. local2.*;local2.!notice/var/log/swift/storage1.log  
  13. local2.notice           /var/log/swift/storage1.error  
  14. local2.*                ~  
  15.    
  16. local3.*;local3.!notice/var/log/swift/storage2.log  
  17. local3.notice           /var/log/swift/storage2.error  
  18. local3.*                ~  
  19.    
  20. local4.*;local4.!notice/var/log/swift/storage3.log  
  21. local4.notice           /var/log/swift/storage3.error  
  22. local4.*                ~  
  23.    
  24. local5.*;local5.!notice/var/log/swift/storage4.log  
  25. local5.notice           /var/log/swift/storage4.error  
  26. local5.*     
  1. 修改/etc/rsyslog.conf:  
  2. 将$PrivDropToGroup  syslog改为$PrivDropToGroup adm  
  3. 执行如下命令  
  4. sudo mkdir -p /var/log/swift/hourly  
  5. sudo chown -R syslog.adm /var/log/swift  
  6. sudo service rsyslog restart  

10. 配置各个节点(以下文件不存在的话需要自己创建)

sudo chmod a+w -R /etc/swift/* 

  1. 1.  /etc/swift/proxy-server.conf  
  2. [DEFAULT]  
  3. bind_port= 8080  
  4. user =swift  
  5. log_facility= LOG_LOCAL1  
  6.    
  7. [pipeline:main]  
  8. pipeline= healthcheck cache swauth proxy-server  
  9.    
  10. [app:proxy-server]  
  11. use =egg:swift#proxy  
  12. allow_account_management= true  
  13. account_autocreate= true  
  14.    
  15. [filter:swauth]  
  16. use =egg:swauth#swauth  
  17. #Highly recommended to change this.  
  18. super_admin_key= swauthkey  
  19. default_swift_cluster= local#http://127.0.0.1:8080/auth/v1.0  
  20.    
  21. [filter:healthcheck]  
  22. use =egg:swift#healthcheck  
  23.    
  24. [filter:cache]  
  25. use =egg:swift#memcache  
  26.    
  27. 2.  /etc/swift/swift.conf  
  28. [swift-hash]  
  29. #random unique string that can never change (DO NOT LOSE)  
  30. swift_hash_path_suffix= cynric   #cynric是可以随意更改的字符串  
  31.    
  32. 3.  /etc/swift/account-server/1.conf  
  33. [DEFAULT]  
  34. devices= /srv/1/node  
  35. mount_check= false  
  36. bind_port= 6012  
  37. user =swift  
  38. log_facility= LOG_LOCAL2  
  39.    
  40. [pipeline:main]  
  41. pipeline= account-server  
  42.    
  43. [app:account-server]  
  44. use =egg:swift#account  
  45.    
  46. [account-replicator]  
  47. vm_test_mode= yes  
  48.    
  49. [account-auditor]  
  50.    
  51. [account-reaper]  
  52. 4.  /etc/swift/account-server/2.conf  
  53. [DEFAULT]  
  54. devices= /srv/2/node  
  55. mount_check= false  
  56. bind_port= 6022  
  57. user =swift  
  58. log_facility= LOG_LOCAL3  
  59.    
  60. [pipeline:main]  
  61. pipeline= account-server  
  62.    
  63. [app:account-server]  
  64. use =egg:swift#account  
  65.    
  66. [account-replicator]  
  67. vm_test_mode= yes  
  68.    
  69. [account-auditor]  
  70.    
  71. [account-reaper]  
  72.    
  73. 5.  /etc/swift/account-server/3.conf  
  74. [DEFAULT]  
  75. devices= /srv/3/node  
  76. mount_check= false  
  77. bind_port= 6032  
  78. user =swift  
  79. log_facility= LOG_LOCAL4  
  80.    
  81. [pipeline:main]  
  82. pipeline= account-server  
  83.    
  84. [app:account-server]  
  85. use =egg:swift#account  
  86.    
  87. [account-replicator]  
  88. vm_test_mode= yes  
  89.    
  90. [account-auditor]  
  91.    
  92. [account-reaper]  
  93.    
  94. 6.  /etc/swift/account-server/4.conf  
  95. [DEFAULT]  
  96. devices= /srv/4/node  
  97. mount_check= false  
  98. bind_port= 6042  
  99. user =swift  
  100. log_facility= LOG_LOCAL5  
  101.    
  102. [pipeline:main]  
  103. pipeline= account-server  
  104.    
  105. [app:account-server]  
  106. use =egg:swift#account  
  107.    
  108. [account-replicator]  
  109. vm_test_mode= yes  
  110.    
  111. [account-auditor]  
  112.    
  113. [account-reaper]  
  114.    
  115. 7.  /etc/swift/container-server/1.conf  
  116. [DEFAULT]  
  117. devices= /srv/1/node  
  118. mount_check= false  
  119. bind_port= 6011  
  120. user =swift  
  121. log_facility= LOG_LOCAL2  
  122.    
  123. [pipeline:main]  
  124. pipeline= container-server  
  125.    
  126. [app:container-server]  
  127. use =egg:swift#container  
  128.    
  129. [container-replicator]  
  130. vm_test_mode= yes  
  131.    
  132. [container-updater]  
  133.    
  134. [container-auditor]  
  135.    
  136. [container-sync]  
  137.    
  138. 8.  /etc/swift/container-server/2.conf  
  139. [DEFAULT]  
  140. devices= /srv/2/node  
  141. mount_check= false  
  142. bind_port= 6021  
  143. user =swift  
  144. log_facility= LOG_LOCAL3  
  145.    
  146. [pipeline:main]  
  147. pipeline= container-server  
  148.    
  149. [app:container-server]  
  150. use =egg:swift#container  
  151.    
  152. [container-replicator]  
  153. vm_test_mode= yes  
  154.    
  155. [container-updater]  
  156.    
  157. [container-auditor]  
  158.    
  159. [container-sync]  
  160.    
  161. 9.  /etc/swift/container-server/3.conf  
  162. [DEFAULT]  
  163. devices= /srv/3/node  
  164. mount_check= false  
  165. bind_port= 6031  
  166. user =swift  
  167. log_facility= LOG_LOCAL4  
  168.    
  169. [pipeline:main]  
  170. pipeline= container-server  
  171.    
  172. [app:container-server]  
  173. use =egg:swift#container  
  174.    
  175. [container-replicator]  
  176. vm_test_mode= yes  
  177.    
  178. [container-updater]  
  179.    
  180. [container-auditor]  
  181.    
  182. [container-sync]  
  183.    
  184. 10./etc/swift/container-server/4.conf  
  185. [DEFAULT]  
  186. devices= /srv/4/node  
  187. mount_check= false  
  188. bind_port= 6041  
  189. user =swift  
  190. log_facility= LOG_LOCAL5  
  191.    
  192. [pipeline:main]  
  193. pipeline= container-server  
  194.    
  195. [app:container-server]  
  196. use =egg:swift#container  
  197.    
  198. [container-replicator]  
  199. vm_test_mode= yes  
  200.    
  201. [container-updater]  
  202.    
  203. [container-auditor]  
  204.    
  205. [container-sync]  
  206.    
  207. 11./etc/swift/object-server/1.conf  
  208. [DEFAULT]  
  209. devices= /srv/1/node  
  210. mount_check= false  
  211. bind_port= 6010  
  212. user =swift  
  213. log_facility= LOG_LOCAL2  
  214.    
  215. [pipeline:main]  
  216. pipeline= object-server  
  217.    
  218. [app:object-server]  
  219. use =egg:swift#object  
  220.    
  221. [object-replicator]  
  222. vm_test_mode= yes  
  223.    
  224. [object-updater]  
  225.    
  226. [object-auditor]  
  227.    
  228. 12./etc/swift/object-server/2.conf  
  229. [DEFAULT]  
  230. devices= /srv/2/node  
  231. mount_check= false  
  232. bind_port= 6020  
  233. user =swift  
  234. log_facility= LOG_LOCAL3  
  235.    
  236. [pipeline:main]  
  237. pipeline= object-server  
  238.    
  239. [app:object-server]  
  240. use =egg:swift#object  
  241.    
  242. [object-replicator]  
  243. vm_test_mode= yes  
  244.    
  245. [object-updater]  
  246.    
  247. [object-auditor]  
  248.    
  249. 13./etc/swift/object-server/3.conf  
  250. [DEFAULT]  
  251. devices= /srv/3/node  
  252. mount_check= false  
  253. bind_port= 6030  
  254. user =swift  
  255. log_facility= LOG_LOCAL4  
  256.    
  257. [pipeline:main]  
  258. pipeline= object-server  
  259.    
  260. [app:object-server]  
  261. use =egg:swift#object  
  262.    
  263. [object-replicator]  
  264. vm_test_mode= yes  
  265.    
  266. [object-updater]  
  267.    
  268. [object-auditor]  
  269.    
  270. 14./etc/swift/object-server/4.conf  
  271. [DEFAULT]  
  272. devices= /srv/4/node  
  273. mount_check= false  
  274. bind_port= 6040  
  275. user =swift  
  276. log_facility= LOG_LOCAL5  
  277.    
  278. [pipeline:main]  
  279. pipeline= object-server  
  280.    
  281. [app:object-server]  
  282. use =egg:swift#object  
  283.    
  284. [object-replicator]  
  285. vm_test_mode= yes  
  286.    
  287. [object-updater]  
  288.    
  289. [object-auditor]  
linux
相关资讯       Ubuntu Server 
本文评论   查看全部评论 (2)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款
第 2 楼
* 匿名 发表于 2013/8/15 11:27:28
回复 Sam 的评论
想请问一下,我执行这一步时swauth-add-user -A http://127.0.0.1:8080/auth/ -K swauthkey -a test tester testing,怎么一直报:Account creation failed: 500 Server Error
User creation failed: 500 Server Error
我也是的啊,怎么办呢?QQ471887916,希望得到你的帮助。
第 1 楼
* Sam 发表于 2012/6/5 17:35:59
想请问一下,我执行这一步时swauth-add-user -A http://127.0.0.1:8080/auth/ -K swauthkey -a test tester testing,怎么一直报:Account creation failed: 500 Server Error
User creation failed: 500 Server Error