Redisのインストールと持続性

この記事で紹介されている非常に浅い知識でRedisのインストールと持続性のためであり、理解していない、ただの接触面は、より複雑なコンテンツのいくつかは、あまりにも多くの記述ではありません。エラーのテキストは、〜ありがとう、保管してください

A、Redisの紹介

リモートの辞書サービスですRedisの(リモート辞書サーバ)が、タイプ、キーと値のデータベースをログに記録し、多言語のAPIを提供することができ、メモリの持続性に基づいて、ANSI C、サポートネットワークで書かれたオープンソースの使用です。

Redisのは、非リレーショナルデータベースの高性能NOSQLシリーズです主に高速な読み取り/書き込みを使用してそれを書く/高速な読み取りを必要とするJava開発やアプリケーションで使用されるキャッシュされたデータを格納するために使用されるのRedis。

メモリベースのデータベースであり、いくつかの永続化機能を提供NoSQLの技術。
RedisのとMongoDBは、現在最も広く使用されているのNoSQLであり、それは技術をのRedis、その性能が優れている、毎秒この読み取り/書き込み操作を数十万人をサポートすることができ、その性能はこれまでデータベースを超え、また、分散したクラスタをサポートしていますスタイル、マスター・スレーブ構成の同期、非常に強力。

一般的には、RedisのRedisの技術とデータベースを区別しませんがRedisのを呼ばれています。
はるかに高速リレーショナルデータベースよりもハードディスクベースのリレーショナルデータベースとは異なり、メモリに基づいており、非リレーショナルデータベースとしてのRedis。しかし、メモリの制限のため、それほどのRedisを使用するときに我々が選択をするために必要なものデータ。
一般用より多くのデータの少量を読みます状況は、そのようなので、上の「バディリストクエリ」「リスト」やなどのRedisを、使用することを検討することができます。

第二に、Redisのインストール

(1)入射githubの-Redisのダウンロード圧縮Redisのを

ここに画像を挿入説明
(2)ダウンロードredis-64-3.0.503.zipを抽出し、直接開いて使用することができます。(うまくダウンロードし解凍し実際には、これは、インストールしない、緑バージョンです)。

  • redis.windows.conf:プロフィール
  • Redisの-cli.exe:Redisのクライアント
  • Redisの-SERVER.EXE:Redisのサーバー

ここに画像を挿入説明

一般的には良いが、サーバー側で開始し、その後、クライアントはRedisのを使用することができます開きます。

三、Redisの持続性

Redisのデータを保存しないように簡単に、メモリに保存されているので(サーバーとクライアントコンピュータがオフまたはシャットダウンされている場合、データは失われます)、ハードディスクに保存されているRedisのデータの順に、次のものが必要持久化テクノロジー。
永続的な1は、2つの方法に分かれているのRedisRDB(デフォルト)、1であります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 1* 900秒内で発現される少なくとも一つのキーが変更された」、それは必要に応じて、我々は、対応する永続的な条件を変更することができ、永続操作を実行します。
各持続した後RDBファイルはRedisのを解凍したディレクトリに保存されます。

(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ファイルはRedisのを解凍したディレクトリに保存されます。

ここに画像を挿入説明
2020年3月7日

公開された52元の記事 ウォン称賛59 ビュー6814

おすすめ

転載: blog.csdn.net/ataraxy_/article/details/104711788