2015-02-10 20 views
6

Tôi vừa cài đặt máy chủ redis trên Windows từ here và chạy máy chủ ở chế độ mặc định không có tệp cấu hình được chỉ định.Redis trên Windows - tệp cấu hình

Làm cách nào để liên kết tệp cấu hình (sử dụng Windows) với máy chủ và làm cách nào để chỉ định thư mục lưu dtb vào?

Thư mục trông như thế này:

  • thư mục: C: \ Program Files \ Redis \ conf - có một số tập tin mẫu conf
  • thư mục: C: \ Program Files \ Redis \ data - trống
  • thư mục: C: \ Program Files \ Redis \ logs - trống
  • file: C: \ Program Files \ Redis \ redis-server.exe
  • file: C: \ Program Files \ Redis \ redis-cli .

Trả lời

10

Tất cả những gì bạn cần làm là chạy redis-server.exe, sau đó là tên tệp của tệp cấu hình của bạn.

ví dụ:

D:\Coding\RedisIO>redis-server.exe redis.windows.conf 

Và đối với những tập tin db bạn cần phải thêm/thay đổi các dòng trong tập tin cấu hình:

# The filename where to dump the DB 
dbfilename dump.rdb 

và dưới đó trong cấu hình tập tin mục

# The working directory. 
# 
# The DB will be written inside this directory, with the filename specified 
# above using the 'dbfilename' configuration directive. 
# 
# The Append Only File and the QFork memory mapped file will also be created 
# inside this directory. 
# 
# Note that you must specify a directory here, not a file name. 
# The working directory. 
# 
# The DB will be written inside this directory, with the filename specified 
# above using the 'dbfilename' configuration directive. 
# 
# The Append Only File and the QFork memory mapped file will also be created 
# inside this directory. 
# 
# Note that you must specify a directory here, not a file name. 
dir ./ 
Các vấn đề liên quan