內(nèi)容教程分析guide_第1頁
內(nèi)容教程分析guide_第2頁
內(nèi)容教程分析guide_第3頁
已閱讀5頁,還剩3頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

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 修改完成后保存,進(jìn)入到 功以后顯示如下信息下,執(zhí)行啟動命令: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 會路由些分片節(jié)點上執(zhí)行,這對分片相很有幫助。另外,explain 可以安全的行多次,它僅僅是告訴你 SQL 的路由分片,而不會執(zhí)行該 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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論