


版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年汽车维修工考试注意事项
- 六年级语文考前互助小组题及答案
- 汽车维修工考试内容的深度解读试题及答案
- 药物相互作用探讨试题及答案
- 2024年统计学考试技巧试题及答案
- 第2讲 匀变速直线运动的规律-2026版大一轮高考物理复习
- 古代文学形态的多样化与发展趋势试题及答案
- 2024年汽车美容行业发展政策试题及答案
- 2024年食品质检员考试案例分析及答案
- 二手车评估师法律法规知识试题及答案
- 江西省南昌中学2024-2025学年高一下学期3月月考地理试题(原卷版+解析版)
- 落实“215”专项行动:xx小学体育“加速度”
- 老年人60岁以上C1驾考三力测试题及答案
- 2020-2021学年江苏省南京外国语河西初级中学等三校七年级(下)期中数学试卷
- 第四单元《认识20~99》-2024-2025学年一年级数学下册单元检测卷(苏教版·2024新教材)
- 小学生航天知识普及课件
- 2025年河南经贸职业学院单招职业技能测试题库及答案一套
- 《自动驾驶技术》课件
- 部编版2025春六年级下册语文11《十六年前的回忆》 课件
- 财务大数据分析与可视化课件 项目3 快速实践Power BI
- DB3303T 059-2023 政务信息化项目软件开发费用测算规范
评论
0/150
提交评论