访问Kubernetes集群中运行的SeaweedFS卷服务器 Jmeter 板

bwleehnv  于 2024-01-07  发布在  Kubernetes
关注(0)|答案(1)|浏览(129)

我已经在on-promises k8s集群中部署了SeaweedFS栈,部署的示例有1个主服务器、1个卷服务器、1个文件服务器和S3 API网关。
我自己定义了k8s Deployment和Service,并且能够使堆栈在集群中运行。我能够使用另一个NestJS后端上传文件,该后端利用s3 API和filer API。堆栈工作正常。
由于它们没有通过Ingress公开,我对master,filer,s3和卷服务器进行了如下的端口转发以进行测试。
x1c 0d1x的数据
我可以通过http://localhost:9333/访问主服务器的接口,通过http://localhost:8888/访问文件服务器,通过http://localhost:8333/访问s3网关。但我无法通过http://localhost:8080/ui/index.html访问卷服务器 Jmeter 板,即使它是端口转发的。我仍然可以通过端口9325从卷服务器获取指标,但端口8080不起作用。
卷服务器的部署和服务定义如下所示。

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: seaweedfs-volume-deployment
  5. spec:
  6. selector:
  7. matchLabels:
  8. app: seaweedfs-volume
  9. template:
  10. metadata:
  11. labels:
  12. app: seaweedfs-volume
  13. spec:
  14. containers:
  15. - name: seaweedfs-volume
  16. image: chrislusf/seaweedfs:3.40
  17. args:
  18. [
  19. 'volume',
  20. '-port',
  21. '8080',
  22. '-mserver',
  23. 'seaweedfs-master-service.namespace.svc.cluster.local:9333',
  24. '-metricsPort',
  25. '9325',
  26. '-dir',
  27. '/data',
  28. '-max',
  29. '14',
  30. ]
  31. ports:
  32. - containerPort: 8080
  33. - containerPort: 18080
  34. - containerPort: 9325
  35. volumeMounts:
  36. - mountPath: /data
  37. name: seaweedfs-volume-pv
  38. restartPolicy: Always
  39. volumes:
  40. - name: seaweedfs-volume-pv
  41. persistentVolumeClaim:
  42. claimName: seaweedfs-volume-pvc
  43. ---
  44. apiVersion: v1
  45. kind: Service
  46. metadata:
  47. name: seaweedfs-volume-service
  48. spec:
  49. selector:
  50. app: seaweedfs-volume
  51. ports:
  52. - name: 'seaweedfs-volume-port'
  53. port: 8080
  54. targetPort: 8080
  55. - name: 'seaweedfs-volume-grpc-port'
  56. port: 18080
  57. targetPort: 18080
  58. - name: 'seaweedfs-volume-metrics-port'
  59. port: 9325
  60. targetPort: 9325

字符串

  • curl的输出-I“http://localhost:9333/cluster/healthz”
  1. HTTP/1.1 200 OK
  2. Date: Thu, 09 Mar 2023 12:55:23 GMT

  • curl“http://localhost:9333/dir/status?pretty = y”的输出
  1. {
  2. "Topology": {
  3. "Max": 14,
  4. "Free": 0,
  5. "DataCenters": [
  6. {
  7. "Id": "DefaultDataCenter",
  8. "Racks": [
  9. {
  10. "Id": "DefaultRack",
  11. "DataNodes": [
  12. {
  13. "Url": "10.1.64.185:8080",
  14. "PublicUrl": "10.1.64.185:8080",
  15. "Volumes": 14,
  16. "EcShards": 0,
  17. "Max": 14,
  18. "VolumeIds": " 1-14"
  19. }
  20. ]
  21. }
  22. ]
  23. }
  24. ],
  25. "Layouts": [
  26. {
  27. "replication": "000",
  28. "ttl": "",
  29. "writables": [
  30. 1,
  31. 2,
  32. 3,
  33. 4,
  34. 5,
  35. 6,
  36. 7
  37. ],
  38. "collection": "test"
  39. },
  40. {
  41. "replication": "000",
  42. "ttl": "",
  43. "writables": [
  44. 8,
  45. 9,
  46. 10,
  47. 11,
  48. 12,
  49. 13,
  50. 14
  51. ],
  52. "collection": ""
  53. }
  54. ]
  55. },
  56. "Version": "30GB 3.40 2885ba0e5"
  57. }%

  • curl的输出“http://localhost:9333/vol/status?pretty = y
  1. {
  2. "Version": "30GB 3.40 2885ba0e5",
  3. "Volumes": {
  4. "DataCenters": {
  5. "DefaultDataCenter": {
  6. "DefaultRack": {
  7. "10.1.64.185:8080": [
  8. {
  9. "Id": 5,
  10. "Size": 8,
  11. "ReplicaPlacement": {},
  12. "Ttl": {
  13. "Count": 0,
  14. "Unit": 0
  15. },
  16. "DiskType": "",
  17. "Collection": "test",
  18. "Version": 3,
  19. "FileCount": 0,
  20. "DeleteCount": 0,
  21. "DeletedByteCount": 0,
  22. "ReadOnly": false,
  23. "CompactRevision": 0,
  24. "ModifiedAtSecond": 1678366273,
  25. "RemoteStorageName": "",
  26. "RemoteStorageKey": ""
  27. },
  28. {
  29. "Id": 6,
  30. "Size": 8,
  31. "ReplicaPlacement": {},
  32. "Ttl": {
  33. "Count": 0,
  34. "Unit": 0
  35. },
  36. "DiskType": "",
  37. "Collection": "test",
  38. "Version": 3,
  39. "FileCount": 0,
  40. "DeleteCount": 0,
  41. "DeletedByteCount": 0,
  42. "ReadOnly": false,
  43. "CompactRevision": 0,
  44. "ModifiedAtSecond": 1678366273,
  45. "RemoteStorageName": "",
  46. "RemoteStorageKey": ""
  47. },
  48. {
  49. "Id": 10,
  50. "Size": 224,
  51. "ReplicaPlacement": {},
  52. "Ttl": {
  53. "Count": 0,
  54. "Unit": 0
  55. },
  56. "DiskType": "",
  57. "Collection": "",
  58. "Version": 3,
  59. "FileCount": 1,
  60. "DeleteCount": 0,
  61. "DeletedByteCount": 0,
  62. "ReadOnly": false,
  63. "CompactRevision": 0,
  64. "ModifiedAtSecond": 1678366369,
  65. "RemoteStorageName": "",
  66. "RemoteStorageKey": ""
  67. },
  68. {
  69. "Id": 14,
  70. "Size": 8,
  71. "ReplicaPlacement": {},
  72. "Ttl": {
  73. "Count": 0,
  74. "Unit": 0
  75. },
  76. "DiskType": "",
  77. "Collection": "",
  78. "Version": 3,
  79. "FileCount": 0,
  80. "DeleteCount": 0,
  81. "DeletedByteCount": 0,
  82. "ReadOnly": false,
  83. "CompactRevision": 0,
  84. "ModifiedAtSecond": 1678366300,
  85. "RemoteStorageName": "",
  86. "RemoteStorageKey": ""
  87. },
  88. {
  89. "Id": 1,
  90. "Size": 8,
  91. "ReplicaPlacement": {},
  92. "Ttl": {
  93. "Count": 0,
  94. "Unit": 0
  95. },
  96. "DiskType": "",
  97. "Collection": "test",
  98. "Version": 3,
  99. "FileCount": 0,
  100. "DeleteCount": 0,
  101. "DeletedByteCount": 0,
  102. "ReadOnly": false,
  103. "CompactRevision": 0,
  104. "ModifiedAtSecond": 1678366273,
  105. "RemoteStorageName": "",
  106. "RemoteStorageKey": ""
  107. },
  108. {
  109. "Id": 3,
  110. "Size": 119064,
  111. "ReplicaPlacement": {},
  112. "Ttl": {
  113. "Count": 0,
  114. "Unit": 0
  115. },
  116. "DiskType": "",
  117. "Collection": "test",
  118. "Version": 3,
  119. "FileCount": 1,
  120. "DeleteCount": 0,
  121. "DeletedByteCount": 0,
  122. "ReadOnly": false,
  123. "CompactRevision": 0,
  124. "ModifiedAtSecond": 1678366273,
  125. "RemoteStorageName": "",
  126. "RemoteStorageKey": ""
  127. },
  128. {
  129. "Id": 4,
  130. "Size": 208,
  131. "ReplicaPlacement": {},
  132. "Ttl": {
  133. "Count": 0,
  134. "Unit": 0
  135. },
  136. "DiskType": "",
  137. "Collection": "test",
  138. "Version": 3,
  139. "FileCount": 1,
  140. "DeleteCount": 0,
  141. "DeletedByteCount": 0,
  142. "ReadOnly": false,
  143. "CompactRevision": 0,
  144. "ModifiedAtSecond": 1678366273,
  145. "RemoteStorageName": "",
  146. "RemoteStorageKey": ""
  147. },
  148. {
  149. "Id": 8,
  150. "Size": 8,
  151. "ReplicaPlacement": {},
  152. "Ttl": {
  153. "Count": 0,
  154. "Unit": 0
  155. },
  156. "DiskType": "",
  157. "Collection": "",
  158. "Version": 3,
  159. "FileCount": 0,
  160. "DeleteCount": 0,
  161. "DeletedByteCount": 0,
  162. "ReadOnly": false,
  163. "CompactRevision": 0,
  164. "ModifiedAtSecond": 1678366300,
  165. "RemoteStorageName": "",
  166. "RemoteStorageKey": ""
  167. },
  168. {
  169. "Id": 11,
  170. "Size": 8,
  171. "ReplicaPlacement": {},
  172. "Ttl": {
  173. "Count": 0,
  174. "Unit": 0
  175. },
  176. "DiskType": "",
  177. "Collection": "",
  178. "Version": 3,
  179. "FileCount": 0,
  180. "DeleteCount": 0,
  181. "DeletedByteCount": 0,
  182. "ReadOnly": false,
  183. "CompactRevision": 0,
  184. "ModifiedAtSecond": 1678366300,
  185. "RemoteStorageName": "",
  186. "RemoteStorageKey": ""
  187. },
  188. {
  189. "Id": 2,
  190. "Size": 8,
  191. "ReplicaPlacement": {},
  192. "Ttl": {
  193. "Count": 0,
  194. "Unit": 0
  195. },
  196. "DiskType": "",
  197. "Collection": "test",
  198. "Version": 3,
  199. "FileCount": 0,
  200. "DeleteCount": 0,
  201. "DeletedByteCount": 0,
  202. "ReadOnly": false,
  203. "CompactRevision": 0,
  204. "ModifiedAtSecond": 1678366273,
  205. "RemoteStorageName": "",
  206. "RemoteStorageKey": ""
  207. },
  208. {
  209. "Id": 7,
  210. "Size": 8,
  211. "ReplicaPlacement": {},
  212. "Ttl": {
  213. "Count": 0,
  214. "Unit": 0
  215. },
  216. "DiskType": "",
  217. "Collection": "test",
  218. "Version": 3,
  219. "FileCount": 0,
  220. "DeleteCount": 0,
  221. "DeletedByteCount": 0,
  222. "ReadOnly": false,
  223. "CompactRevision": 0,
  224. "ModifiedAtSecond": 1678366273,
  225. "RemoteStorageName": "",
  226. "RemoteStorageKey": ""
  227. },
  228. {
  229. "Id": 9,
  230. "Size": 8,
  231. "ReplicaPlacement": {},
  232. "Ttl": {
  233. "Count": 0,
  234. "Unit": 0
  235. },
  236. "DiskType": "",
  237. "Collection": "",
  238. "Version": 3,
  239. "FileCount": 0,
  240. "DeleteCount": 0,
  241. "DeletedByteCount": 0,
  242. "ReadOnly": false,
  243. "CompactRevision": 0,
  244. "ModifiedAtSecond": 1678366300,
  245. "RemoteStorageName": "",
  246. "RemoteStorageKey": ""
  247. },
  248. {
  249. "Id": 12,
  250. "Size": 8,
  251. "ReplicaPlacement": {},
  252. "Ttl": {
  253. "Count": 0,
  254. "Unit": 0
  255. },
  256. "DiskType": "",
  257. "Collection": "",
  258. "Version": 3,
  259. "FileCount": 0,
  260. "DeleteCount": 0,
  261. "DeletedByteCount": 0,
  262. "ReadOnly": false,
  263. "CompactRevision": 0,
  264. "ModifiedAtSecond": 1678366300,
  265. "RemoteStorageName": "",
  266. "RemoteStorageKey": ""
  267. },
  268. {
  269. "Id": 13,
  270. "Size": 1056,
  271. "ReplicaPlacement": {},
  272. "Ttl": {
  273. "Count": 0,
  274. "Unit": 0
  275. },
  276. "DiskType": "",
  277. "Collection": "",
  278. "Version": 3,
  279. "FileCount": 1,
  280. "DeleteCount": 0,
  281. "DeletedByteCount": 0,
  282. "ReadOnly": false,
  283. "CompactRevision": 0,
  284. "ModifiedAtSecond": 1678366309,
  285. "RemoteStorageName": "",
  286. "RemoteStorageKey": ""
  287. }
  288. ]
  289. }
  290. }
  291. },
  292. "Free": 0,
  293. "Max": 14
  294. }
  295. }

  • 在mac上进行端口转发后,lsof -i :8080命令不输出任何内容。

我试着在docker-compose中使用相同的配置运行堆栈,如下所示,并且我能够通过http://localhost:8080/ui/index.html访问卷服务器 Jmeter 板。

  1. services:
  2. seaweedfs_master:
  3. image: chrislusf/seaweedfs:3.40
  4. ports:
  5. - 9333:9333
  6. - 19333:19333
  7. - 9324:9324
  8. command: 'master -ip=master -ip.bind=0.0.0.0 -metricsPort=9324 -volumeSizeLimitMB=200'
  9. seaweedfs_volume:
  10. image: chrislusf/seaweedfs:3.40
  11. ports:
  12. - 8080:8080
  13. - 18080:18080
  14. - 9325:9325
  15. command: 'volume -mserver="seaweedfs_master:9333" -ip.bind=0.0.0.0 -port=8080 -metricsPort=9325 -dir="/data" -max=14'
  16. volumes:
  17. - ./volume:/data
  18. depends_on:
  19. - seaweedfs_master
  20. seaweedfs_filer:
  21. image: chrislusf/seaweedfs:3.40
  22. ports:
  23. - 8888:8888
  24. - 18888:18888
  25. - 9326:9326
  26. command: 'filer -master="seaweedfs_master:9333" -ip.bind=0.0.0.0 -metricsPort=9326'
  27. environment:
  28. WEED_POSTGRES2_HOSTNAME: ${SEAWEEDFS_FILER_POSTGRES_HOST}
  29. WEED_POSTGRES2_DATABASE: ${SEAWEEDFS_FILER_POSTGRES_DB}
  30. WEED_POSTGRES2_USERNAME: ${SEAWEEDFS_FILER_POSTGRES_USER}
  31. WEED_POSTGRES2_PASSWORD: ${SEAWEEDFS_FILER_POSTGRES_PASSWORD}
  32. volumes:
  33. - ./seaweedfs/filer.toml:/etc/seaweedfs/filer.toml
  34. depends_on:
  35. - seaweedfs_master
  36. - seaweedfs_volume
  37. seaweedfs_filer_postgres:
  38. image: postgres:12
  39. environment:
  40. POSTGRES_DB: ${SEAWEEDFS_FILER_POSTGRES_DB}
  41. POSTGRES_USER: ${SEAWEEDFS_FILER_POSTGRES_USER}
  42. POSTGRES_PASSWORD: ${SEAWEEDFS_FILER_POSTGRES_PASSWORD}
  43. PGDATA: /var/lib/postgresql/data/pgdata
  44. volumes:
  45. - seaweed-filer-postgres-data:/data/postgres
  46. ports:
  47. - '55433:5432'
  48. seaweedfs_s3:
  49. image: chrislusf/seaweedfs:3.40
  50. ports:
  51. - 8333:8333
  52. - 9327:9327
  53. command: 's3 -filer="seaweedfs_filer:8888" -ip.bind=0.0.0.0 -metricsPort=9327 -config=/etc/seaweedfs/s3-config.json'
  54. volumes:
  55. - ./seaweedfs/s3-config.json:/etc/seaweedfs/s3-config.json
  56. depends_on:
  57. - seaweedfs_master
  58. - seaweedfs_volume
  59. - seaweedfs_filer


我为卷服务器设置了不同于8080的端口,并通过k8s Service相应地暴露了它,但在端口转发之后,我仍然无法访问 Jmeter 板。

k2fxgqgv

k2fxgqgv1#

第808章已经被人抢走了

相关问题