microsoft / garnet

Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet can work with existing Redis clients.
https://microsoft.github.io/garnet/
MIT License
10.18k stars 508 forks source link

Port number does not match expectations #454

Closed shijunpeng15 closed 3 months ago

shijunpeng15 commented 3 months ago

Describe the bug

When I pulled the image and ran it, I checked the running commands as follows: [./GarnetServer - i 128m -- port 6379] [-- config import path/app/garnet. json]. The port number used for execution was not declared in the garnet.json file, and it is also not 3278.

My docker-compose.yml:

 version: '3.8'
services:
  garnet:
    restart: always
    privileged: true
    image: 'ghcr.io/microsoft/garnet'
    container_name: garnet
    ulimits:
      memlock: -1
    ports:
      - "6370:6379"   # 6370:6370
    network_mode: "bridge"
    volumes:
      - /usr/local/docker/garnet/garnet.json:/app/garnet.json
      - /usr/local/docker/garnet/data:/data
      - /usr/local/docker/garnet/logs:/logs
    command: --config-import-path /app/garnet.json

My garnet.json:

{
  "Port": 6370,
  "Address": "0.0.0.0",
  "AuthenticationMode": "Password",
  "Password": "123456",
  "EnableAOF": true,
  "Recover": true
 "CheckpointDir":"/logs"
}

Steps to reproduce the bug

...

Expected behavior

No response

Screenshots

No response

Release version

No response

IDE

No response

OS version

No response

Additional context

No response

shijunpeng15 commented 3 months ago

garnet.json or garnet.conf ? ... they both work

badrishc commented 3 months ago

garnet.json or garnet.conf ? ... they both work

you can name it however you want.

"6370:6379"

why does this have two different ports?

[./GarnetServer - i 128m -- port 6379]

why is there a space between -- and port. The whole line is badly formatted.

shijunpeng15 commented 3 months ago

garnet.json or garnet.conf ? ... they both work

you can name it however you want.

"6370:6379"

why does this have two different ports?

[./GarnetServer - i 128m -- port 6379]

why is there a space between -- and port. The whole line is badly formatted.

sorry, copy wrong .please see the picture. garnet.json set 6370,but not work

image

shijunpeng15 commented 3 months ago

image

Setting the port number under the command parameter is effective, but it doesn't work in the configuration file

badrishc commented 3 months ago

conf doesn't work because the command line above overrides it to 6379 - see above your screenshot

image

shijunpeng15 commented 3 months ago

conf doesn't work because the command line above overrides it to 6379 - see above your screenshot

image

hope the command line does not display port. This can easily be misleading. Use default port without configuration file, use configuration port with configuration file