


版權(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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 醫(yī)學(xué)基礎(chǔ)知識學(xué)習(xí)方式探索試題及答案
- 藥物配伍禁忌知識試題及答案
- 激光工程師知識回顧與鞏固技巧試題及答案
- 藥劑創(chuàng)新應(yīng)用示例試題及答案
- 藥物吸收影響因素考點試題及答案
- 南康中學(xué)測試題及答案
- 激光技術(shù)職業(yè)發(fā)展試題及答案
- 網(wǎng)絡(luò)規(guī)劃設(shè)計師考試職業(yè)發(fā)展機會探討試題及答案
- 光電工程師證書考試案例分析試題及答案
- 系統(tǒng)架構(gòu)設(shè)計師薄弱環(huán)節(jié)的突破試題及答案
- 離職體檢免責(zé)協(xié)議書
- 光電工程師需掌握的常用計算試題及答案
- 3D打印在康復(fù)輔具中的應(yīng)用-全面剖析
- 縣級安全生產(chǎn)大講堂課件
- 北京市門頭溝區(qū)2025屆高三一模考試生物試題(原卷版+解析版)
- 安徽省合肥市2024-2025學(xué)年高三下學(xué)期第二次教學(xué)質(zhì)量檢測生物學(xué)試卷(含答案)
- 2025年中國詩詞大會知識競賽模擬題庫及答案(215題)
- 物業(yè)部團(tuán)隊建設(shè)與管理
- 焊接知識培訓(xùn)課件模板
- 棱柱棱錐棱臺的表面積與體積課件-高一下學(xué)期數(shù)學(xué)人教A版
- 廣東省深圳市寶安區(qū)2023-2024學(xué)年七年級下學(xué)期數(shù)學(xué)期中試卷(含答案)
評論
0/150
提交評論