


版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、MyCAT ThesofMyCATrunsonwhichserveralsorunss.HereMyCAT ThesofMyCATrunsonwhichserveralsorunss.HerewetheinstallationsofMyCATisimplementedinJDK1.7,soJRE1.7orlatermustbeforrunningYoucoulddownloadandinstallJDKorJREfromtheURLGetthenewestofMyCATttolocateallfilesonthe/usr/local/MyCAT,withoutanycharacterindir
2、ectorynames,liketheThefollowingisthewaytomodifyMyCatuserspassword(forFollowing subdirectories below MyCAT are with the meanings as Directory named bin, stores scriptsfilesforLinuxandbatfilesforWindows.Allthe s,andnowrappedones.YoucanchooseyourwaytoDirectory named bin, stores scriptsfilesforLinuxandb
3、atfilesforWindows.Allthe s,andnowrappedones.Youcanchooseyourwaytouse,modifythemasyourInWindows,runmycat.batincmdwindow.Youcanconfigittobeawindowsservice. confirmdisdsasod+xnohup sh mycat console hewrapmode,itcanbeinstalledasaservicetobestartedandmycat install mycat Directory named conf, stores confi
4、guration files. XML server.xml contains configurations runningand authorizing MyCATserver arguments. XMLschema.xmlcontains configurationsfor logicdatabase,tabledefinationsandshardingdefinations.XMLrule.xmlcontainsshardingrules,andargumentsofshardingrulesarestoredasotherhisdirectorytoo.XMLcontainscon
5、figurationsforlog,andyoucanmodifyitasyourt,thewrapmodeprocedure,whoseJVMargumentsareconf/wrap.conf.Youcanmodifyitasyoure.The./doc/english/properties.html is reference to ThereisaninstanceofwrapmodeNOTE:MyCATrequiresJDK1.7.ItwouldthrowsomeexceptionswithJDK1.6.Youspecifiytheabsolutepathofheconfigurati
6、onfileTHE FOLLOWING ARE SOME CONFIGRATIONS IN #JavaAdditionalwrapper.java.additional.5=-#InitialJavaHeapSize#umJavaHeapSizeIftherearenotenoughRAMstostartup,youcouldtrytospecifyall#umJavaHeapSizeIftherearenotenoughRAMstostartup,youcouldtrytospecifyallmemoryparamssuch1GorLogfileisstoredinog,onelogfile
7、perday.Itcouldoutputmoreinfo,runningdebuglevel,inordertoYoucanrunserveronthesamemachinewhichisrunningaMyCATinQUICK,andensureitcouldbelogedinandexecutedCRUDConnect CREATE database CREATE database CREATE database NOTE:ifisforLinux,lettercaseinsensitiveisrequired,otherwise,tablecannotfoundbyMyCATprobab
8、ly.Theconfigisaslower_case_table_names=To modify database connection should compliance with connection 修改完成后保存,进入到 功以后显示如下信息下,执行启动命令:startup.bat ,启动To save all modified configuration files, switch directory to MYCAT_HOME/bin, startup.batinwindowsormycatstartindT,defaultportfordatais8066,andportforTo
9、 save all modified configuration files, switch directory to MYCAT_HOME/bin, startup.batinwindowsormycatstartindT,defaultportfordatais8066,andportformanagementisYousouseGUIchworkbench, navicat, and some other database implementsinjava.Tospecifyportas8066,anddatabasenameasdfollowingdline,youcansutest
10、ptest h P8066 Allsqlwillbebechangedtodlinents.IfJDBCistobeused,theport theusernameandpasswordconnectedbyMyCATarestoredinTheyarethetwoindepencysystems,andlogicaldatabases(schemas)andlogicaltablesMyCATwithrespecttodatabaseandySQLareFOLLOWINGISASIMPLETable employee, is sharded according to the rule of
11、sharding-by-infile, whose sharding field Createtableemployeebyfollowingcreate table employee not null primary key,name notexplain create table employee not null primary key,name Itat,checkdefinitionofemployeeinschema.xmlanditsshardingrule,and twhichdatawillbeindn1,andwhichwillbein温馨提示:explain 可Itat,
12、checkdefinitionofemployeeinschema.xmlanditsshardingrule,and twhichdatawillbeindn1,andwhichwillbein温馨提示:explain 可以用于任何正确的SQL 上,其作用是告诉你,这条SQL 会路由些分片节点上执行,这对分片相很有帮助。另外,explain 可以安全的行多次,它仅仅是告诉你 SQL 的路由分片,而不会执行该 SQLdexplaincouldbeusedforcorrectSQL,lyouwhichnodethesqlwillroutedtoexecute.Itisuseful todiagn
13、oseproblemsaboutsharding.d couldbesafelyexecutedmultipletimes, lsyoutheshardingrouteesofSQL,butINSERTo employee(id,name,sharding_id) values(1,leader Table company is sharded according to auto-sharding-long y following createtablenot null primary key,name INSERTo company(id,name) o company(id,name) Y
14、ouwillseethethreerecordsaboveareglobal table. Execute oconfirmexplain o company(id,name) |+|o company(id,name) values(1,hp) |o company(id,name) values(1,hp) |o company(id,name) values(1,hp) +Createtablecreatecustomer: createtablenotnullprimary|+|o company(id,name) values(1,hp) |o company(id,name) va
15、lues(1,hp) |o company(id,name) values(1,hp) +Createtablecreatecustomer: createtablenotnullprimarynot not INSERTinocustomerpany_id,sharding_id inocustomerpany_id,sharding_id ino customer pany_id,sharding_id )values(3,feng,3,10000); EXECUTESelect*from explainSelect*from customer; #CONFIRMDATASARESTORE
16、DBYCreatetableorders,andinsertcreatetableordersvarchar(100) notnullprimarykeynoto orders(id,customer_id) values(1,1); /stored in db1 because customer table id=1storedino orders(id,customer_id) values(2,2); /stored in db2 because customer table id=1storedinexplain o orders(id,customer_id) select ,ord
17、ers.* from customer ,orders Createtabletravelrecordandinsertsravelrecordisexplain o orders(id,customer_id) select ,orders.* from customer ,orders Createtabletravelrecordandinsertsravelrecordisstoredbyshardingruleofidcreate travelrecord: create table travelrecord (id o travelrecord (id,user_id,traveldate,fee,days) values(1,wang,2014-05,510.5,3);#this id is stored in node explain o travelrecord values(7000001,wang,2014-05,510.5,3);#thisidisstoredinnodeTOEXECUTEACROSS-SHARDING create table not null primary key ,title varchar(400) ,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025标准商业借款合同范本
- 2024年诊断用药项目资金需求报告代可行性研究报告
- 2025年视觉识别设计合同范本
- 2025信托公司与银行存款保管合同
- 2025解除劳动合同协议书样本格式
- 2025商业店铺租赁合同模板
- 2025年度合作合同货车挂靠协议
- 2025华瑞科技产品销售合同副本(修正版)
- 2025健身教练劳动合同范本
- 2025音乐演出取消、延迟保险合同
- 2025年广州铁路职业技术学院单招职业适应性考试题库附答案
- 电子商务订单处理流程优化计划
- 艺术中的记忆与遗忘-深度研究
- TSCBDIF 001-2024 AI 大模型应用能力成熟度评价标准
- 《大学生创新创业基础》选修笔记
- 社交媒体招聘效果评估-深度研究
- 谱写全球南方团结合作的新篇章-2025年春季学期形势与政策课件
- 菌群失衡与多囊卵巢综合征痰湿证型生物学内涵相关性研究进展
- 2025年河南林业职业学院高职单招高职单招英语2016-2024历年频考点试题含答案解析
- 医疗机构未成年人伤害事件强制报告制度
- 教师学习《中小学教育惩戒规则(试行)》心得体会
评论
0/150
提交评论