레디 스 설치 및 지속성

이 문서는 단지 접촉면을 이해하지 못하고, 소개 매우 얕은 지식 레디 스 설치 및 지속성을위한, 더 복잡한 내용 중 일부는 너무 많이 설명하지 않습니다. 오류의 텍스트, ~ 감사합니다, 보관하십시오

A, 레디 스 소개

원격 사전 서비스입니다 레디 스 (원격 사전 서버), 유형, 키 - 값 데이터베이스를 기록 할 수있는 메모리의 지속성에 따라 ANSI C, 지원 네트워크로 작성된 오픈 소스 사용하고, 다 언어 API를 제공한다.

레디 스 비 관계형 데이터베이스의 고성능 NOSQL 시리즈이며, 주로 / 빨리 읽을 필요 캐시 자바 개발에 사용되는 데이터 및 응용 프로그램을 저장하는 빠른 읽기 / 쓰기를 사용하여 작성하는 데 사용 레디 스.

메모리 기반의 데이터베이스이며, 일부 지속성 NoSQL의 기능을 제공하는 기술.
성능 분산, 우수 초당 수천이 읽기 / 쓰기 작업의 수백을 지원, 성능은 지금까지 데이터베이스를 초과하고 또한 클러스터를 지원, 레디 스 및 MongoDB를 현재 가장 널리 사용되는 NoSQL이며, 기술 레디 스 스타일, 마스터 - 슬레이브 구성 동기화, 매우 강력.

일반적으로, 레디 스 레디 스 기술을 구분하지 않고 데이터베이스 레디 스를 부른다.
훨씬 더 빨리 관계형 데이터베이스보다 하드 디스크 기반 관계형 데이터베이스, 달리 메모리를 기반으로하는 비 관계형 데이터베이스로 레디 스. 그러나, 우리는 선택을해야 할 필요가있는 데이터 레디 스를 사용하므로 메모리의 한계로 인해.
일반의 경우더 적은 양의 데이터를 읽기상황은 그래서 "친구 목록 쿼리" "목록"등의 레디 스를 사용하여 고려할 수 있습니다.

둘째, 레디 스를 설치

(1)은 입사 GitHub의-레디 스의 다운로드를 압축 레디 스

그림 삽입 설명 여기
(2)가 다운로드 redis-64-3.0.503.zip 추출 직접 오픈이 사용될 수있다. ((가) 잘 다운로드의 압축을 풉니 다 사실, 이것은 설치하지 마십시오, 녹색 버전입니다).

  • redis.windows.conf : 프로필
  • 레디 스-cli.exe은 : 클라이언트 레디 스
  • 레디 스-SERVER.EXE은 : 서버 레디 스

그림 삽입 설명 여기

일반적으로 좋은 서버 측에서 시작하여 클라이언트가 레디 스를 사용할 수 있습니다 엽니 다.

세, 레디 스 지속성

레디 스 데이터가 메모리에 저장되기 때문에, 쉽지 않은 (서버와 클라이언트 컴퓨터가 꺼져있을 때 또는 데이터가 손실됩니다, 종료) 저장하는 하드 디스크에 저장 레디 스 데이터를 위해, 당신은 필요지구력 화기술.
지속 한 두 가지 방법으로 나누어 져 레디 스RDB(기본값), 하나는AOF방법.

(1) RDB

redis.windows.conf구성 파일은 특별히 지속적 RDB에이 구성됩니다.

################################ SNAPSHOTTING  ################################
#
# Save the DB on disk:
#
#   save <seconds> <changes>
#
#   Will save the DB if both the given number of seconds and the given
#   number of write operations against the DB occurred.
#
#   In the example below the behaviour will be to save:
#   after 900 sec (15 min) if at least 1 key changed
#   after 300 sec (5 min) if at least 10 keys changed
#   after 60 sec if at least 10000 keys changed
#
#   Note: you can disable saving completely by commenting out all "save" lines.
#
#   It is also possible to remove all the previously configured save
#   points by adding a save directive with a single empty string argument
#   like in the following example:
#
#   save ""

save 900 1
save 300 10
save 60 10000

* "그의 900 일"900초 키가 변경된 적어도 하나에 표현 *, 그것은 필요에 따라 우리가 대응 영구 조건을 수정할 수 영속성 동작을 수행한다.
각각의 지속되면RDB이 파일은 레디 스의 추출 된 디렉토리에 저장됩니다.

(2) AOF : 모드 로깅 동작 명령마다 및 지속성이 기록 될 수있다

redis.windows.conf구성 파일은 특별히 지속적 AOF에이 구성됩니다.

############################## APPEND ONLY MODE ###############################

# By default Redis asynchronously dumps the dataset on disk. This mode is
# good enough in many applications, but an issue with the Redis process or
# a power outage may result into a few minutes of writes lost (depending on
# the configured save points).
#
# The Append Only File is an alternative persistence mode that provides
# much better durability. For instance using the default data fsync policy
# (see later in the config file) Redis can lose just one second of writes in a
# dramatic event like a server power outage, or a single write if something
# wrong with the Redis process itself happens, but the operating system is
# still running correctly.
#
# AOF and RDB persistence can be enabled at the same time without problems.
# If the AOF is enabled on startup Redis will load the AOF, that is the file
# with the better durability guarantees.
#
# Please check http://redis.io/topics/persistence for more information.

appendonly no

"appendonly 없음"AOF는 설정하려면 기본 모드가 꺼져 있음을 나타냅니다에는 yes로 변경되지 않습니다.

# The fsync() call tells the Operating System to actually write data on disk
# instead of waiting for more data in the output buffer. Some OS will really flush
# data on disk, some other OS will just try to do it ASAP.
#
# Redis supports three different modes:
#
# no: don't fsync, just let the OS flush the data when it wants. Faster.
# always: fsync after every write to the append only log . Slow, Safest.
# everysec: fsync only one time every second. Compromise.
#
# The default is "everysec", as that's usually the right compromise between
# speed and data safety. It's up to you to understand if you can relax this to
# "no" that will let the operating system flush the output buffer when
# it wants, for better performances (but if you can live with the idea of
# some data loss consider the default persistence mode that's snapshotting),
# or on the contrary, use "always" that's very slow but a bit safer than
# everysec.
#
# More details please check the following article:
# http://antirez.com/post/redis-persistence-demystified.html
#
# If unsure, use "everysec".

# appendfsync always
appendfsync everysec
# appendfsync no

"appendfsync 항상"각각의 작업이 지속된다는 것을 나타냅니다."appendfsync everysec"매 초마다 지속적인 작업 (이 기본값입니다)를 나타냅니다"appendfsync 없음어떤 작업 지속성 "을 의미한다.
지속적 후마다AOF이 파일은 레디 스의 추출 된 디렉토리에 저장됩니다.

그림 삽입 설명 여기
2020년 3월 7일

게시 52 개 원래 기사 · 원 찬양 59 · 전망 6814

추천

출처blog.csdn.net/ataraxy_/article/details/104711788