??twemproxy redis ttserver phpadmin memcache

來源:互聯網
上載者:User

標籤:

1.system update

LANG=C

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers


2. pcre install
//path:pcre-8.10

./configure

make && make install


3. Lua install
//path:lua-5.1.5

make install

4.luarocks install
//path:luarocks-2.1.0

./configure
make && make install

5.lua extension install
yum install expat-devel

luarocks install lbase64
luarocks install lua-cjson
luarocks install lua-iconv
luarocks install luacrypto
luarocks install luaexpat
luarocks install luasocket
luarocks install luasql-mysql
luarocks install luaxml

//download zlib and install
luarocks install lzlib
luarocks install md5


//more see:http://rhomobi.com/topics/186

# library for connectting to mysql
yum install mysql-devel
luarocks install luasql-mysql MYSQL_INCDIR=/usr/include/mysql MYSQL_LIBDIR=/usr/lib64/mysql

6.rhongx install
//path:src
useradd www
./configure --user=www --group=www --prefix=/usr/local/webserver/rhongx --with-http_stub_status_module --with-http_ssl_module --with-debug --with-http_gzip_static_module --without-mail_pop3_module --without-mail_imap_module --without-http_uwsgi_module --without-http_scgi_module --without-http_ssi_module --add-module=../lua-nginx-module-0.6.10 --add-module=../ngx_devel_kit-0.2.17 --add-module=../memc-nginx-module --add-module=../srcache-nginx-module --add-module=../echo-nginx-module --add-module=../ngx_cache_purge-1.6 --add-module=../evanmiller-nginx_upstream_hash-2580b21 --add-module=../nginx-gridfs --add-module=../nginx_upload_module-2.2.0 --add-module=../masterzen-nginx-upload-progress-module-82b35fc --add-module=../nginx-accesskey-2.0.3 --add-module=../set-misc-nginx-module --add-module=../iconv-nginx-module

make && make install
7.update /etc/sysctl.conf

# Disable netfilter on bridges.
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

# Add
net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog =  32768
net.core.somaxconn = 32768

net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216

net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2

net.ipv4.tcp_tw_recycle = 1
#net.ipv4.tcp_tw_len = 1
net.ipv4.tcp_tw_reuse = 1

net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
#
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 120
net.ipv4.ip_local_port_range = 1024  65535

#Redis2.6.17need
vm.overcommit_memory = 1

# End

8. start Redis
mkdir /data/logs/redis/6399 -p
/opt/redis-2.6.17/src/redis-server /data/sgcore/ngx/cfg/sg.aof.conf

9. start rhongx
/usr/local/webserver/rhongx/sbin/nginx -t -c /data/sgcore/ngx/cfg/ly.ngx.conf
/usr/local/webserver/rhongx/sbin/nginx  -c /data/sgcore/ngx/cfg/ly.ngx.conf

#access  http://sg1.mangocity.com/api/pdb/SceneryDetail/321/  405 Not Allowed

10. restart rhongx
ps -ef | grep "nginx: master process" | grep -v "grep" | awk -F ‘ ‘ ‘{print $2}‘
kill -HUP ‘pid number‘

11、twemproxy-0.4.0
yum remove autoconf*
autoconf-2.69.tar.gz
automake-1.12.5.tar
libtool-2.4.2.tar.xz
twemproxy-0.4.0.tar.gz
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar xzvf autoconf-2.69.tar.gz
cd ./autoconf-2.69
./configure
make
make install
tar xzvf automake-1.12.5.tar.xz
xz -d automake-1.12.5.tar.xz
tar xf automake-1.12.5.tar
cd ./automake-1.12.5
./configure
make
make install
xz -d libtool-2.4.2.tar.xz
tar xf libtool-2.4.2.tar
cd ./libtool-2.4.2
./configure
make
make install
cd ../twemproxy-0.4.0
autoreconf -fvi
./configure --prefix=/usr/src/twemproxy4
make
make install

[[email protected] twemproxy-0.4.0]# cd /usr/src/twemproxy4/
[[email protected] twemproxy4]# ll
total 8
drwxr-xr-x 2 root root 4096 Dec 19 13:25 sbin
drwxr-xr-x 3 root root 4096 Dec 19 11:38 share
[[email protected] twemproxy4]# mkdir run conf
[[email protected] twemproxy4]# cd ./conf/
[[email protected] conf]# vim nutcracker.yml  

alpha:
  listen: 10.10.130.93:61390
  hash: fnv1a_64
  distribution: ketama
  auto_eject_hosts: true
  redis: true
  redis_auth: redispassword
  server_retry_timeout: 2000
  server_failure_limit: 1
  servers:
   - 10.10.42.93:6390:1
   - 10.10.42.93:6392:1
   - 10.10.42.93:6394:1


gamma:
  listen: 10.10.130.93:61978
  hash: fnv1a_64
  distribution: ketama
  backlog: 1024
  auto_eject_hosts: true
  server_retry_timeout: 3000
  server_failure_limit: 3
  servers:
   - 10.10.42.93:1978:1
   - 10.10.42.93:2978:1
   - 10.10.42.93:3978:1
   - 10.10.42.93:4978:1

 啟動twemproxy服務

nutcracker -t 測試組態檔案nutcracker -d -c /usr/src/twemproxy/conf/nutcracker.yml -p /usr/src/twemproxy/run/redisproxy.pid -o /usr/src/twemproxy/run/redisproxy.log

nutcracker用法與命令選項

Usage: nutcracker [-?hVdDt] [-v verbosity level] [-o output file][-c conf file] [-s stats port] [-a stats addr][-i stats interval] [-p pid file] [-m mbuf size]

Options:
-h, –help                        : 查看協助文檔,顯示命令選項
-V, –version                   : 查看nutcracker版本
-t, –test-conf                  : 測試組態指令碼的正確性
-d, –daemonize              : 以守護進程運行
-D, –describe-stats         : 列印狀態原因
-v, –verbosity=N            : 設定記錄層級 (default: 5, min: 0, max: 11)
-o, –output=S                 : 設定日誌輸出路徑,預設為標準錯誤輸出 (default: stderr)
-c, –conf-file=S               : 指定設定檔路徑 (default: conf/nutcracker.yml)
-s, –stats-port=N            : 設定狀態監控連接埠,預設22222 (default: 22222)
-a, –stats-addr=S            : 設定狀態監控IP,預設0.0.0.0 (default: 0.0.0.0)
-i, –stats-interval=N       : 設定狀態彙總間隔 (default: 30000 msec)
-p, –pid-file=S                 : 指定進程pid檔案路徑,預設關閉 (default: off)
-m, –mbuf-size=N          : 設定mbuf塊大小,以bytes單位 (default: 16384 bytes)

 

12、ttserver
wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.46.tar.gz
wget http://jaist.dl.sourceforge.net/project/tokyocabinet/tokyotyrant/1.1.33/tokyotyrant-1.1.33.tar.gz 
tar zxvf tokyocabinet-1.4.46.tar.gz
cd tokyocabinet-1.4.46 
./configure --prefix=/usr/local/tokyocabinet
make
make install
tar zxvf tokyotyrant-1.1.33.tar.gz
cd tokyotyrant-1.1.33
./configure  --prefix=/usr/local/ttserver/ --with-tc=/usr/local/tokyocabinet/ 
make  
make install
/usr/src/ttserver/bin/ttserver -host 10.10.42.201 -port 42201 -thnum 8 -dmn -pid /data/ttserver/ttserver42201.pid -log /data/ttserver/log/ttserver42201.log -le -ulog /data/ttserver/ulog/ -ulim 128m -sid 42201 -mhost 10.10.42.202 -mport 42202 -rcc -rts /data/ttserver/data/ttserver.rts /data/ttserver/data/database.tch#bnum=10000
/usr/src/ttserver/bin/ttserver -host 10.10.42.202 -port 42202 -thnum 8 -dmn -pid /data/ttserver/ttserver42202.pid -log /data/ttserver/log/ttserver42202.log -le -ulog /data/ttserver/ulog/ -ulim 128m -sid 42202 -mhost 10.10.42.201 -mport 42201 -rcc -rts /data/ttserver/data/ttserver.rts /data/ttserver/data/database.tch#bnum=10000

13、redis
wget https://github.com/antirez/redis/archive/3.0.0-rc1.tar.gz
tar xzvf 3.0.0-rc1.tar.gz
mv redis-3.0.0-rc1 /usr/src/redis3-0

 

 

??twemproxy redis ttserver phpadmin memcache

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.