Memcachedb Application Guide 2: Compilation and Installation

Source: Internet
Author: User

From: http://blog.csdn.net/simonlsy/article/details/2027940

Like memcachedb, network socket data processing depends on libevent. Therefore, you need to download three installation packages, libevent and Berkeley, before installation.
DB and memcachedb.

Libevent download page: http://monkey.org /~ Provos/libevent/, just download the latest stable version.

Berkeley dB download page: http://www.oracle.com/technology/software/products/berkeley-db/index.html needs to install version 4.6

Memcachedb download page: http://code.google.com/p/memcachedb/ download the latest version 0.1.0

Install libevent and Berkeley dB in sequence. The standard is Linux.

[===== Libevent ===]

Tar-zxvf libevent-1.3e.tar.gz

CD libevent-1.3e

./Configure

Make & make install

[===== Berkeley dB ===]

Tar-zxvf db-4.6.19.tar.gz

# You need to enter the compiling environment of a specific operating system. There are some differences in the compilation of more general software.

CD db-4.6.19/build_unix/

# Then you can start compiling

../Dist/configure

Make & make install

# If no special installation path is specified and compilation is complete, add the path of the Berkeley dB Runtime Library to the system configuration.

Echo "/usr/local/berkeleydb.4.6/lib/">/etc/lD. So. conf

# Reload the system LD Runtime Library

Ldconfig

[====== Memcachedb ====]

Tar-zxvf memcachedb-0.1.0.tar.gz

CD memcachedb-0.1.0

# If the length of the key value of the content you want to store and the length of a single content changes, you need to change the memcachedb. h file.

Vim memcachedb. h

//////////////////////////////////////// ////////////////////

# Define end_len 32 ----> This is the maximum length of key + value.
# Define end_len_str "31" ---> This is the maximum length of the key.

//////////////////////////////////////// /////////////////

# By default, the key value is only reserved for 31 bytes. the maximum number of bytes for a single data record is 32.

# For example, if you need to use this method to store text content data, assume that your key value is a 32-byte MD5 and a single data record can be up to 10 KB, you can set

//////////////////////////////////////// ////////////////////

# Define end_len 102400 ----> This is the maximum length of key + value.
# Define end_len_str "32" ---> This is the maximum length of the key.

//////////////////////////////////////// /////////////////

# Make directly after modification

Make

# After compilation, copy the generated executable memcachedb to/usr/sbin/

CP-F memcachedb/usr/sbin/

# Start memcachedb

# First, read/write merge mode, that is, no secondary copy, that is, read and write, no redundant backup

Memcachedb-p21211-d-r-u root-H/data/mdb_000011-n

# Second, read/write splitting/backup mode

# Master server 192.168.0.1 read/write listener 11211, synchronized through port 31211, do not occupy busy master service port

Memcachedb-p21211-d-r-u root-H/data/mdb_201711_m-n-r 127.0.0.1: 31211-m

# The secondary server 192.168.0.2 listens to port 21212 read-only, synchronizes data from Port 31211 of 192.168.0.1, and opens another port 31212 to provide the data synchronization service.

Memcachedb-p21212-d-r-u root-H/data/mdb_201711_from_16801_s-O 192.168.0.1: 31211-r 192.168.0.2: 31212-S

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.