Linux command
valkey-server 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start server with defaults
valkey-server
Start with configuration file
valkey-server [/etc/valkey/valkey.conf]
Start on specific port
valkey-server --port [6379]
Start with password
valkey-server --requirepass [password]
Start with max memory limit
valkey-server --maxmemory [256mb]
Start in protected mode disabled
valkey-server --protected-mode no
Start as daemon
valkey-server --daemonize yes
Start with AOF persistence
valkey-server --appendonly yes
Start as replica
valkey-server --replicaof [127.0.0.1] [6379]
Start in sentinel mode
valkey-server --sentinel
说明
valkey-server is the server component of Valkey, an open-source in-memory data store forked from Redis. It provides high-performance key-value storage with support for strings, hashes, lists, sets, sorted sets, and more. Valkey is fully compatible with Redis OSS 7.2 and earlier versions. Existing Redis clients, applications, and tools work with Valkey by simply changing the connection endpoint. The server supports persistence through RDB snapshots and AOF (Append Only File). Clustering and replication enable high availability and horizontal scaling. Valkey 8.0+ includes enhanced multi-threaded I/O and improved memory efficiency over Redis.
参数
- --port _port_
- Listen port (default: 6379).
- --bind _address_
- Bind address (default: 127.0.0.1).
- --requirepass _password_
- Require password for connections.
- --maxmemory _bytes_
- Maximum memory limit.
- --maxclients _n_
- Maximum client connections.
- --daemonize _yes|no_
- Run as daemon.
- --pidfile _file_
- PID file location.
- --logfile _file_
- Log file location.
- --loglevel _level_
- Log level: debug, verbose, notice, warning.
- --appendonly _yes|no_
- Enable append-only persistence.
- --save _seconds_ _changes_
- Snapshot save rules.
- --protected-mode _yes|no_
- Enable protected mode.
- --dir _directory_
- Working directory for persistence.
- --replicaof _host_ _port_
- Start as a replica of the specified server.
- --sentinel
- Start in Sentinel mode for high availability monitoring.
- --tls-port _port_
- Listen for TLS connections on specified port.
- --io-threads _n_
- Number of I/O threads for improved performance (default: 1, disabled).
- --cluster-enabled _yes|no_
- Enable cluster mode.
- --dbfilename _file_
- Filename for the RDB snapshot (default: dump.rdb).
FAQ
What is the valkey-server command used for?
valkey-server is the server component of Valkey, an open-source in-memory data store forked from Redis. It provides high-performance key-value storage with support for strings, hashes, lists, sets, sorted sets, and more. Valkey is fully compatible with Redis OSS 7.2 and earlier versions. Existing Redis clients, applications, and tools work with Valkey by simply changing the connection endpoint. The server supports persistence through RDB snapshots and AOF (Append Only File). Clustering and replication enable high availability and horizontal scaling. Valkey 8.0+ includes enhanced multi-threaded I/O and improved memory efficiency over Redis.
How do I run a basic valkey-server example?
Run `valkey-server` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --port _port_ do in valkey-server?
Listen port (default: 6379).