oneproxy5.8.1新版本的配置

//oneproxy5.8.1新版本的配置
# by coco
# 20160224

1. 下载:
http://www.onexsoft.com/?page_id=3391   //下载对应版本的,下载完成后上传服务器
http://www.onexsoft.cn/software/step_into_oneproxy.pdf  //说明文档
wget http://www.onexsoft.cn/software/oneproxy-rhel6-linux64-v5.8.1-ga.tar.gz

2. 解压配置即可
tar -zxvf oneproxy-rhel6-linux64-v5.8.1-ga.tar.gz -C /data/

 cp demo.sh start.sh

//start.sh文件内容如下
[root@cnhbase112 oneproxy]# cat start.sh 
#/bin/bash
#
export ONEPROXY_HOME=/data/oneproxy

# valgrind --leak-check=full --show-reachable=yes \
${ONEPROXY_HOME}/oneproxy --defaults-file=${ONEPROXY_HOME}/proxy.conf

//proxy.con配置服务器,客户端连接的用户等信息
 cp proxy.conf proxybak.conf
[oneproxy]
keepalive     = 1
event-threads = 4
log-file      = log/oneproxy.log
pid-file      = log/oneproxy.pid
lck-file      = log/oneproxy.lck

mysql-version            = 5.6.27
proxy-address            = :3307
proxy-master-addresses.1 = 192.168.0.113:3306@server1

proxy-user-list          = mha_user/389433BDF5A642E23483ED08E6E62D91E7E5B7CF@wwn
proxy-user-group         = server1:mha_user/389433BDF5A642E23483ED08E6E62D91E7E5B7CF

#proxy-part-template      = conf/template.txt
#proxy-part-tables.1      = conf/part.txt
proxy-part-tables.2      = conf/part2.txt
#proxy-charset            = gbk_chinese_ci
proxy-charset            = utf8_general_ci
proxy-group-policy       = server1:0
proxy-table-security    =  pdcheck_hlbr:0

proxy-secure-client      = 192.168.0.113

remote-address           = 192.168.0.113:4041
vip-address              = 192.168.0.120/eth0:0


//拆分测试表。
[root@db113 conf]# cat part2.txt 
[
   {
        "table"   : "pdcheck_hlbr",
        "pkey"    : "cid",
        "type"    : "int",
        "method"  : "hash",
        "partitions":
           [
               { "suffix" : "_0", "group": "server1" },
               { "suffix" : "_1", "group": "server1" },
               { "suffix" : "_2", "group": "server1" },
               { "suffix" : "_3", "group": "server1" }
           ]
   }
]

4. 启动:
sh start.sh

5. 用管理端口登陆:
mysql -h192.168.0.113 -uadmin -pOneProxy -P4041
mysql> passwd statis895316;          //查看你所用用户的密码加密后的内容。

6. 应用使用:注意必须有拆分字段
  mysql -h192.168.0.113 -umha_user -pgc895316 -P3307
mysql> select * from pdcheck_hlbr WHERE cid=73974663 and (hash_a =35617 or hash_b=17569 or hash_c =36589 or hash_d= 2232);

mysql>insert into  pdcheck_hlbr(pid,cid,cname,hash,hash_a,hash_b,hash_c,hash_d) values(7397,4663,17569,36,58,9,2232);   


你可能感兴趣的:(oneproxy5.8.1新版本的配置)