我已经在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不起作用。
卷服务器的部署和服务定义如下所示。
apiVersion: apps/v1
kind: Deployment
metadata:
name: seaweedfs-volume-deployment
spec:
selector:
matchLabels:
app: seaweedfs-volume
template:
metadata:
labels:
app: seaweedfs-volume
spec:
containers:
- name: seaweedfs-volume
image: chrislusf/seaweedfs:3.40
args:
[
'volume',
'-port',
'8080',
'-mserver',
'seaweedfs-master-service.namespace.svc.cluster.local:9333',
'-metricsPort',
'9325',
'-dir',
'/data',
'-max',
'14',
]
ports:
- containerPort: 8080
- containerPort: 18080
- containerPort: 9325
volumeMounts:
- mountPath: /data
name: seaweedfs-volume-pv
restartPolicy: Always
volumes:
- name: seaweedfs-volume-pv
persistentVolumeClaim:
claimName: seaweedfs-volume-pvc
---
apiVersion: v1
kind: Service
metadata:
name: seaweedfs-volume-service
spec:
selector:
app: seaweedfs-volume
ports:
- name: 'seaweedfs-volume-port'
port: 8080
targetPort: 8080
- name: 'seaweedfs-volume-grpc-port'
port: 18080
targetPort: 18080
- name: 'seaweedfs-volume-metrics-port'
port: 9325
targetPort: 9325
字符串
- curl的输出-I“http://localhost:9333/cluster/healthz”
HTTP/1.1 200 OK
Date: Thu, 09 Mar 2023 12:55:23 GMT
型
- curl“http://localhost:9333/dir/status?pretty = y”的输出
{
"Topology": {
"Max": 14,
"Free": 0,
"DataCenters": [
{
"Id": "DefaultDataCenter",
"Racks": [
{
"Id": "DefaultRack",
"DataNodes": [
{
"Url": "10.1.64.185:8080",
"PublicUrl": "10.1.64.185:8080",
"Volumes": 14,
"EcShards": 0,
"Max": 14,
"VolumeIds": " 1-14"
}
]
}
]
}
],
"Layouts": [
{
"replication": "000",
"ttl": "",
"writables": [
1,
2,
3,
4,
5,
6,
7
],
"collection": "test"
},
{
"replication": "000",
"ttl": "",
"writables": [
8,
9,
10,
11,
12,
13,
14
],
"collection": ""
}
]
},
"Version": "30GB 3.40 2885ba0e5"
}%
型
- curl的输出“http://localhost:9333/vol/status?pretty = y
{
"Version": "30GB 3.40 2885ba0e5",
"Volumes": {
"DataCenters": {
"DefaultDataCenter": {
"DefaultRack": {
"10.1.64.185:8080": [
{
"Id": 5,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "test",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366273,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 6,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "test",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366273,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 10,
"Size": 224,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "",
"Version": 3,
"FileCount": 1,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366369,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 14,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366300,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 1,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "test",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366273,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 3,
"Size": 119064,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "test",
"Version": 3,
"FileCount": 1,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366273,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 4,
"Size": 208,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "test",
"Version": 3,
"FileCount": 1,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366273,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 8,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366300,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 11,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366300,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 2,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "test",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366273,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 7,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "test",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366273,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 9,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366300,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 12,
"Size": 8,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "",
"Version": 3,
"FileCount": 0,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366300,
"RemoteStorageName": "",
"RemoteStorageKey": ""
},
{
"Id": 13,
"Size": 1056,
"ReplicaPlacement": {},
"Ttl": {
"Count": 0,
"Unit": 0
},
"DiskType": "",
"Collection": "",
"Version": 3,
"FileCount": 1,
"DeleteCount": 0,
"DeletedByteCount": 0,
"ReadOnly": false,
"CompactRevision": 0,
"ModifiedAtSecond": 1678366309,
"RemoteStorageName": "",
"RemoteStorageKey": ""
}
]
}
}
},
"Free": 0,
"Max": 14
}
}
型
- 在mac上进行端口转发后,
lsof -i :8080
命令不输出任何内容。
我试着在docker-compose中使用相同的配置运行堆栈,如下所示,并且我能够通过http://localhost:8080/ui/index.html访问卷服务器 Jmeter 板。
services:
seaweedfs_master:
image: chrislusf/seaweedfs:3.40
ports:
- 9333:9333
- 19333:19333
- 9324:9324
command: 'master -ip=master -ip.bind=0.0.0.0 -metricsPort=9324 -volumeSizeLimitMB=200'
seaweedfs_volume:
image: chrislusf/seaweedfs:3.40
ports:
- 8080:8080
- 18080:18080
- 9325:9325
command: 'volume -mserver="seaweedfs_master:9333" -ip.bind=0.0.0.0 -port=8080 -metricsPort=9325 -dir="/data" -max=14'
volumes:
- ./volume:/data
depends_on:
- seaweedfs_master
seaweedfs_filer:
image: chrislusf/seaweedfs:3.40
ports:
- 8888:8888
- 18888:18888
- 9326:9326
command: 'filer -master="seaweedfs_master:9333" -ip.bind=0.0.0.0 -metricsPort=9326'
environment:
WEED_POSTGRES2_HOSTNAME: ${SEAWEEDFS_FILER_POSTGRES_HOST}
WEED_POSTGRES2_DATABASE: ${SEAWEEDFS_FILER_POSTGRES_DB}
WEED_POSTGRES2_USERNAME: ${SEAWEEDFS_FILER_POSTGRES_USER}
WEED_POSTGRES2_PASSWORD: ${SEAWEEDFS_FILER_POSTGRES_PASSWORD}
volumes:
- ./seaweedfs/filer.toml:/etc/seaweedfs/filer.toml
depends_on:
- seaweedfs_master
- seaweedfs_volume
seaweedfs_filer_postgres:
image: postgres:12
environment:
POSTGRES_DB: ${SEAWEEDFS_FILER_POSTGRES_DB}
POSTGRES_USER: ${SEAWEEDFS_FILER_POSTGRES_USER}
POSTGRES_PASSWORD: ${SEAWEEDFS_FILER_POSTGRES_PASSWORD}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- seaweed-filer-postgres-data:/data/postgres
ports:
- '55433:5432'
seaweedfs_s3:
image: chrislusf/seaweedfs:3.40
ports:
- 8333:8333
- 9327:9327
command: 's3 -filer="seaweedfs_filer:8888" -ip.bind=0.0.0.0 -metricsPort=9327 -config=/etc/seaweedfs/s3-config.json'
volumes:
- ./seaweedfs/s3-config.json:/etc/seaweedfs/s3-config.json
depends_on:
- seaweedfs_master
- seaweedfs_volume
- seaweedfs_filer
型
我为卷服务器设置了不同于8080的端口,并通过k8s Service相应地暴露了它,但在端口转发之后,我仍然无法访问 Jmeter 板。
1条答案
按热度按时间k2fxgqgv1#
第808章已经被人抢走了