成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

Twemproxy安裝配置-創(chuàng)新互聯(lián)

簡(jiǎn)介:

創(chuàng)新互聯(lián)專業(yè)為企業(yè)提供大箐山網(wǎng)站建設(shè)、大箐山做網(wǎng)站、大箐山網(wǎng)站設(shè)計(jì)、大箐山網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、大箐山企業(yè)網(wǎng)站模板建站服務(wù),10余年大箐山做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。

簡(jiǎn)單來(lái)說(shuō),twemproxy是twitter開(kāi)發(fā)的一個(gè)redis代理proxy。

通過(guò)Twemproxy可以使用多臺(tái)服務(wù)器來(lái)水平擴(kuò)張redis服務(wù),可以有效的避免單點(diǎn)故障問(wèn)題。

雖然使用Twemproxy需要更多的硬件資源和在redis性能有一定的損失(twitter測(cè)試約20%),

但是能夠提高整個(gè)系統(tǒng)的HA也是相當(dāng)劃算的。

Twemproxy可以把數(shù)據(jù)sharding到多臺(tái)服務(wù)器的上,每臺(tái)服務(wù)器存儲(chǔ)著整個(gè)數(shù)據(jù)集的一部分。

因而,當(dāng)某一臺(tái)redis服務(wù)器宕機(jī)了,那么也就失去了一部分?jǐn)?shù)據(jù)。如果借助于redis的master-slave replication,

能保證在任何一臺(tái)redis不能工作情況下,仍然能夠保證能夠存在一個(gè)整個(gè)數(shù)據(jù)集的完全覆蓋,

那么整個(gè)redis  group(或者稱作cluster)仍然能夠正常工作。

安裝配置:

autoconf下載地址:http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz

twemproxy的安裝要求autoconf的版本在2.64以上,否則提示”error: Autoconf version 2.64 or higher is required“。autoconf直接make和make install即可。

twemproxy下載地址:https://codeload.github.com/twitter/twemproxy/zip/master

下載完成后進(jìn)入twemproxy-master目錄

[root@redis-server twemproxy-master]# autoreconf --install

libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.

libtoolize: copying file `config/ltmain.sh'

libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.

libtoolize: copying file `m4/libtool.m4'

libtoolize: copying file `m4/ltoptions.m4'

libtoolize: copying file `m4/ltsugar.m4'

libtoolize: copying file `m4/ltversion.m4'

libtoolize: copying file `m4/lt~obsolete.m4'

libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'

configure.ac:36: installing 'config/config.guess'

configure.ac:36: installing 'config/config.sub'

configure.ac:16: installing 'config/install-sh'

configure.ac:16: installing 'config/missing'

src/Makefile.am: installing 'config/depcomp'

[root@redis-server twemproxy-master]# autoconf -f -i -v

autoconf: running /usr/local/bin/autom4te -f --melt -v --language=autoconf --output=configure configure.ac

autom4te: the trace request object is:

autom4te: $VAR1 = bless( [

autom4te:          '4',

autom4te:          0,

autom4te:          [

autom4te:           '/usr/local/share/autoconf'

autom4te:          ],

autom4te:          [

autom4te:           '/usr/local/share/autoconf/m4sugar/m4sugar.m4',

autom4te:           '/usr/local/share/autoconf/m4sugar/m4sh.m4',

autom4te:           '/usr/local/share/autoconf/autoconf/autoconf.m4',

autom4te:           'aclocal.m4',

autom4te:           'configure.ac'

autom4te:          ],

autom4te:          {

autom4te:           '_LT_AC_TAGCONFIG' => 1,

autom4te:           'AM_PROG_F77_C_O' => 1,

autom4te:           'AC_INIT' => 1,

autom4te:           'm4_pattern_forbid' => 1,

autom4te:           '_AM_COND_IF' => 1,

autom4te:           'AC_CANONICAL_TARGET' => 1,

autom4te:           'AC_SUBST' => 1,

autom4te:           'AC_CONFIG_LIBOBJ_DIR' => 1,

autom4te:           'AC_FC_SRCEXT' => 1,

autom4te:           'AC_CANONICAL_HOST' => 1,

autom4te:           'AC_PROG_LIBTOOL' => 1,

autom4te:           'AM_INIT_AUTOMAKE' => 1,

autom4te:           'AM_PATH_GUILE' => 1,

autom4te:           'AC_CONFIG_SUBDIRS' => 1,

autom4te:           'AM_AUTOMAKE_VERSION' => 1,

autom4te:           'LT_CONFIG_LTDL_DIR' => 1,

autom4te:           'AC_REQUIRE_AUX_FILE' => 1,

autom4te:           'AC_CONFIG_LINKS' => 1,

autom4te:           'm4_sinclude' => 1,

autom4te:           'LT_SUPPORTED_TAG' => 1,

autom4te:           'AM_MAINTAINER_MODE' => 1,

autom4te:           'AM_NLS' => 1,

autom4te:           'AC_FC_PP_DEFINE' => 1,

autom4te:           'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,

autom4te:           'AM_MAKEFILE_INCLUDE' => 1,

autom4te:           '_m4_warn' => 1,

autom4te:           'AM_PROG_CXX_C_O' => 1,

autom4te:           '_AM_COND_ENDIF' => 1,

autom4te:           '_AM_MAKEFILE_INCLUDE' => 1,

autom4te:           'AM_ENABLE_MULTILIB' => 1,

autom4te:           'AM_SILENT_RULES' => 1,

autom4te:           'AM_PROG_MOC' => 1,

autom4te:           'AC_CONFIG_FILES' => 1,

autom4te:           'include' => 1,

autom4te:           'LT_INIT' => 1,

autom4te:           'AM_PROG_AR' => 1,

autom4te:           'AM_GNU_GETTEXT' => 1,

autom4te:           'AC_LIBSOURCE' => 1,

autom4te:           'AM_PROG_FC_C_O' => 1,

autom4te:           'AC_CANONICAL_BUILD' => 1,

autom4te:           'AC_FC_FREEFORM' => 1,

autom4te:           'AH_OUTPUT' => 1,

autom4te:           'AC_FC_PP_SRCEXT' => 1,

autom4te:           '_AM_SUBST_NOTMAKE' => 1,

autom4te:           'AC_CONFIG_AUX_DIR' => 1,

autom4te:           'sinclude' => 1,

autom4te:           'AM_PROG_CC_C_O' => 1,

autom4te:           'm4_pattern_allow' => 1,

autom4te:           'AM_XGETTEXT_OPTION' => 1,

autom4te:           'AC_CANONICAL_SYSTEM' => 1,

autom4te:           'AM_CONDITIONAL' => 1,

autom4te:           'AC_CONFIG_HEADERS' => 1,

autom4te:           'AC_DEFINE_TRACE_LITERAL' => 1,

autom4te:           'AM_POT_TOOLS' => 1,

autom4te:           'm4_include' => 1,

autom4te:           '_AM_COND_ELSE' => 1,

autom4te:           'AC_SUBST_TRACE' => 1

autom4te:          }

autom4te:         ], 'Autom4te::Request' );

autom4te: running: /usr/local/bin/m4 --nesting-limit=1024 --gnu --include=/usr/local/share/autoconf --debug=aflq --fatal-warning --debugfile=autom4te.cache/traces.4t --trace=AC_CANONICAL_BUILD --trace=AC_CANONICAL_HOST --trace=AC_CANONICAL_SYSTEM --trace=AC_CANONICAL_TARGET --trace=AC_CONFIG_AUX_DIR --trace=AC_CONFIG_FILES --trace=AC_CONFIG_HEADERS --trace=AC_CONFIG_LIBOBJ_DIR --trace=AC_CONFIG_LINKS --trace=AC_CONFIG_SUBDIRS --trace=AC_DEFINE_TRACE_LITERAL --trace=AC_FC_FREEFORM --trace=AC_FC_PP_DEFINE --trace=AC_FC_PP_SRCEXT --trace=AC_FC_SRCEXT --trace=AC_INIT --trace=AC_LIBSOURCE --trace=AC_PROG_LIBTOOL --trace=AC_REQUIRE_AUX_FILE --trace=AC_SUBST --trace=AC_SUBST_TRACE --trace=AH_OUTPUT --trace=AM_AUTOMAKE_VERSION --trace=AM_CONDITIONAL --trace=AM_ENABLE_MULTILIB --trace=AM_GNU_GETTEXT --trace=AM_GNU_GETTEXT_INTL_SUBDIR --trace=AM_INIT_AUTOMAKE --trace=AM_MAINTAINER_MODE --trace=AM_MAKEFILE_INCLUDE --trace=AM_NLS --trace=AM_PATH_GUILE --trace=AM_POT_TOOLS --trace=AM_PROG_AR --trace=AM_PROG_CC_C_O --trace=AM_PROG_CXX_C_O --trace=AM_PROG_F77_C_O --trace=AM_PROG_FC_C_O --trace=AM_PROG_MOC --trace=AM_SILENT_RULES --trace=AM_XGETTEXT_OPTION --trace=LT_CONFIG_LTDL_DIR --trace=LT_INIT --trace=LT_SUPPORTED_TAG --trace=_AM_COND_ELSE --trace=_AM_COND_ENDIF --trace=_AM_COND_IF --trace=_AM_MAKEFILE_INCLUDE --trace=_AM_SUBST_NOTMAKE --trace=_LT_AC_TAGCONFIG --trace=_m4_warn --trace=include --trace=m4_include --trace=m4_pattern_allow --trace=m4_pattern_forbid --trace=m4_sinclude --trace=sinclude /usr/local/share/autoconf/m4sugar/m4sugar.m4 /usr/local/share/autoconf/m4sugar/m4sh.m4 /usr/local/share/autoconf/autoconf/autoconf.m4 aclocal.m4 configure.ac > autom4te.cache/output.4t

autom4te: formatting traces for `/tmp/am4tcWNSQj/warnings': _m4_warn

autom4te: reading /tmp/am4tcWNSQj/warnings

autom4te: creating configure

autom4te: formatting traces for `/tmp/am4tcWNSQj/patterns': m4_pattern_allow, m4_pattern_forbid

autom4te: forbidden tokens: ^_?A[CHUM]_|_AC_|^LIBOBJS$|^_?m4_|^dnl$|^_?AS_|^_?LT_[A-Z_]+$

autom4te: forbidden token : ^LIBOBJS$ => do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'

autom4te: allowed  tokens: ^AS_FLAGS$|^SHELL$|^PATH_SEPARATOR$|^PACKAGE_NAME$|^PACKAGE_TARNAME$|^PACKAGE_VERSION$|^PACKAGE_STRING$|^PACKAGE_BUGREPORT$|^PACKAGE_URL$|^exec_prefix$|^prefix$|^program_transform_name$|^bindir$|^sbindir$|^libexecdir$|^datarootdir$|^datadir$|^sysconfdir$|^sharedstatedir$|^localstatedir$|^includedir$|^oldincludedir$|^docdir$|^infodir$|^htmldir$|^dvidir$|^pdfdir$|^psdir$|^libdir$|^localedir$|^mandir$|^PACKAGE_NAME$|^PACKAGE_TARNAME$|^PACKAGE_VERSION$|^PACKAGE_STRING$|^PACKAGE_BUGREPORT$|^PACKAGE_URL$|^DEFS$|^ECHO_C$|^ECHO_N$|^ECHO_T$|^LIBS$|^build_alias$|^host_alias$|^target_alias$|^AM_[A-Z]+FLAGS$|^INSTALL_PROGRAM$|^INSTALL_SCRIPT$|^INSTALL_DATA$|^am__isrc$|^CYGPATH_W$|^PACKAGE$|^VERSION$|^PACKAGE$|^VERSION$|^ACLOCAL$|^AUTOCONF$|^AUTOMAKE$|^AUTOHEADER$|^MAKEINFO$|^install_sh$|^STRIP$|^INSTALL_STRIP_PROGRAM$|^MKDIR_P$|^mkdir_p$|^AWK$|^SET_MAKE$|^am__leading_dot$|^AMTAR$|^am__tar$|^am__untar$|^AM_V$|^AM_DEFAULT_V$|^AM_DEFAULT_VERBOSITY$|^AM_BACKSLASH$|^NC_VERSION_MAJOR$|^NC_VERSION_MINOR$|^NC_VERSION_PATCH$|^NC_VERSION_STRING$|^AWK$|^CC$|^CFLAGS$|^LDFLAGS$|^LIBS$|^CPPFLAGS$|^CC$|^CC$|^CC$|^CC$|^ac_ct_CC$|^EXEEXT$|^OBJEXT$|^DEPDIR$|^am__include$|^am__quote$|^AMDEP_TRUE$|^AMDEP_FALSE$|^AMDEPBACKSLASH$|^am__nodep$|^CCDEPMODE$|^am__fastdepCC_TRUE$|^am__fastdepCC_FALSE$|^CPP$|^CPPFLAGS$|^CPP$|^CXX$|^CXXFLAGS$|^LDFLAGS$|^LIBS$|^CPPFLAGS$|^CXX$|^ac_ct_CXX$|^CXXDEPMODE$|^am__fastdepCXX_TRUE$|^am__fastdepCXX_FALSE$|^LN_S$|^SET_MAKE$|^RANLIB$|^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$|^LIBTOOL$|^build$|^build_cpu$|^build_vendor$|^build_os$|^host$|^host_cpu$|^host_vendor$|^host_os$|^SED$|^GREP$|^EGREP$|^FGREP$|^GREP$|^LD$|^DUMPBIN$|^ac_ct_DUMPBIN$|^DUMPBIN$|^NM$|^OBJDUMP$|^OBJDUMP$|^DLLTOOL$|^DLLTOOL$|^AR$|^ac_ct_AR$|^STRIP$|^RANLIB$|LT_OBJDIR|^LT_OBJDIR$|^MANIFEST_TOOL$|^DSYMUTIL$|^NMEDIT$|^LIPO$|^OTOOL$|^OTOOL64$|^STDC_HEADERS$|^HAVE_DLFCN_H$|^CXXCPP$|^CPPFLAGS$|^CXXCPP$|^LD$|^int8_t$|^int16_t$|^int32_t$|^int64_t$|^HAVE_UNSIGNED_LONG_LONG_INT$|^HAVE_LONG_LONG_INT$|^HAVE_INTMAX_T$|^intmax_t$|^HAVE_INTPTR_T$|^intptr_t$|^_UINT8_T$|^uint8_t$|^uint16_t$|^_UINT32_T$|^uint32_t$|^_UINT64_T$|^uint64_t$|^HAVE_UINTMAX_T$|^uintmax_t$|^HAVE_UINTPTR_T$|^uintptr_t$|^off_t$|^pid_t$|^size_t$|^ssize_t$|^WORDS_BIGENDIAN$|^HAVE_LITTLE_ENDIAN$|^HAVE__BOOL$|^HAVE_STDBOOL_H$|^HAVE_EXECINFO_H$|^HAVE_BACKTRACE$|^HAVE_SYS_EPOLL_H$|^HAVE_SYS_EVENT_H$|^HAVE_LIBM$|^HAVE_LIBPTHREAD$|^HAVE_VFORK_H$|^HAVE_WORKING_VFORK$|^vfork$|^HAVE_WORKING_FORK$|^HAVE_STDLIB_H$|^HAVE_MALLOC$|^HAVE_MALLOC$|^LIBOBJS$|^malloc$|^HAVE_STDLIB_H$|^HAVE_REALLOC$|^HAVE_REALLOC$|^LIBOBJS$|^realloc$|^HAVE_SOCKET$|^HAVE_EPOLL$|^HAVE_KQUEUE$|^HAVE_EVENT_PORTS$|^OS_LINUX_TRUE$|^OS_LINUX_FALSE$|^OS_BSD_TRUE$|^OS_BSD_FALSE$|^OS_SOLARIS_TRUE$|^OS_SOLARIS_FALSE$|^OS_FREEBSD_TRUE$|^OS_FREEBSD_FALSE$|^HAVE_ASSERT_PANIC$|^HAVE_DEBUG_LOG$|^HAVE_ASSERT_LOG$|^HAVE_DEBUG_LOG$|^HAVE_DEBUG_LOG$|^HAVE_STATS$|^subdirs$|^LIBOBJS$|^LTLIBOBJS$|^am__EXEEXT_TRUE$|^am__EXEEXT_FALSE$

編譯安裝twemproxy

./configure --prefix=/export/Server/twemproxy

報(bào)錯(cuò)

configure: error: cannot find install-sh, install.sh, or shtool in config "."/config

方法:

automake --add-missing

再來(lái):

./configure --prefix=/export/Server/twemproxy

報(bào)錯(cuò)

config.status: error: cannot find input file: `Makefile.in'

方法:

automake --add-missing

automake

再來(lái):

./configure --prefix=/export/Server/twemproxy

成功

最后

make -j 8

make install

添加環(huán)境變量

echo "PATH=$PATH:/export/Server/twemproxy/sbin/" >> /etc/profile

source /etc/profile

新建配置文件

創(chuàng)建pid文件目錄

cd /usr/local/twemproxy

mkdir run

創(chuàng)建proxy配置文件

mkdir sbin/conf

cd /sbin/conf

拷貝配置文件

cp /data/packages/twemproxy-master/conf/nutcracker.yml /usr/local/twemproxy/sbin/conf

然后根據(jù)需求修改配置文件

測(cè)試配置文件語(yǔ)法正確性

[root@redis-server sbin]# ./nutcracker -t

測(cè)試配置文件的時(shí)候報(bào)錯(cuò)

nutcracker: configuration file 'conf/nutcracker.yml' syntax is invalid

conf下面的nutcracker.yml文件必須放在twemproxy/sbin/目錄下,否則報(bào)上面錯(cuò)誤

再次測(cè)試

[root@redis-server sbin]# ./nutcracker -t

nutcracker: configuration file 'conf/nutcracker.yml' syntax is ok

啟動(dòng)

./nutcracker -d -c /export/Server/twemproxy/sbin/conf/nutcracker.yml -p /export/Server/twemproxy/run/redisproxy.pid -o /export/Server/twemproxy/run/redisproxy.log

查看日志

/export/Server/twemproxy/run/redisproxy.log

性能測(cè)試

這里使用redis自帶的redis-benchmark進(jìn)行簡(jiǎn)單的性能測(cè)試,測(cè)試結(jié)果如下:

Set測(cè)試:

通過(guò)twemproxy測(cè)試:

[root@redis-server src]#redis-benchmark -h 10.23.22.240 -p 22121 -c 100 -t set -d 100 -l –q

SET: 38167.94 requests per second

直接對(duì)后端redis測(cè)試:

[root@redis-server ~]#redis-benchmark -h 10.23.22.241 -p 6379 -c 100 -t set -d 100 -l –q

SET: 53191.49 requests per second

Get測(cè)試:

通過(guò)twemproxy測(cè)試:

[root@redis-server src]#redis-benchmark -h 10.23.22.240 -p 22121 -c 100 -t get -d 100 -l -q

GET: 37453.18 requests per second

直接對(duì)后端redis測(cè)試:

[root@redis-server ~]#redis-benchmark -h 10.23.22.241 -p 6379 -c 100 -t get -d 100 -l -q

GET: 62111.80 requests per second

查看鍵值分布:

[root@redis-server ~]#redis-cli info|grep db0

db0:keys=51483,expires=0,avg_ttl=0

[root@redis-server ~]#redis-cli info|grep db0

db0:keys=48525,expires=0,avg_ttl=0

測(cè)試結(jié)果:以基本的set get命令通過(guò)twemproxy性能有所下降;通過(guò)twemproxy分布基本平均。測(cè)試數(shù)據(jù)以業(yè)務(wù)測(cè)試為準(zhǔn)。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

網(wǎng)站名稱:Twemproxy安裝配置-創(chuàng)新互聯(lián)
本文地址:http://jinyejixie.com/article42/deojec.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供手機(jī)網(wǎng)站建設(shè)、Google、網(wǎng)站設(shè)計(jì)品牌網(wǎng)站建設(shè)、云服務(wù)器企業(yè)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁(yè)設(shè)計(jì)
莆田市| 黎川县| 福安市| 云南省| 祁阳县| 增城市| 宜章县| 申扎县| 鹰潭市| 乌拉特后旗| 新营市| 辛集市| 黄梅县| 托克逊县| 西林县| 库尔勒市| 天祝| 璧山县| 新营市| 汝南县| 承德县| 突泉县| 鹿邑县| 丹寨县| 新密市| 平塘县| 河津市| 霍林郭勒市| 红原县| 东乡| 玉门市| 博湖县| 甘肃省| 宜昌市| 凌海市| 崇礼县| 淳化县| 平遥县| 宜丰县| 安化县| 古交市|