author | Eaton
Introduction | With the development of micro services and cloud , The need for distributed architecture is becoming more and more common ,Web Data types on are no longer single , The amount of data is growing explosively . Conventional SQL Structured storage solutions can't keep up , NoSQL There is a .DCache Based on TARS Distributed NoSQL Cache system , Perfect support TARS service , It is convenient to TARS Use in service , This series will focus on DCache Installation and use of . So how to have this system ？ This article will DCache How to install and create applications .
- SQL And NoSQL
- Environment depends on
- Compiling and constructing
- establish DCache application
With the development of mobile Internet and cloud , The number of users is growing , Business access is growing , The expansion of resources alone can not solve all the problems . Especially for e-commerce platforms 、 Audio and video on demand, etc , There is massive data access , The query efficiency is very high , Traditional database disks IO It's hard to satisfy .
To solve this problem ,NoSQL The database was born , It works by caching data into memory , When used, it is called directly from memory , Greatly reduce the number of disks IO The cost of , Improve query efficiency , Combined with distributed computing, it can also process massive data . This NoSQL, Specifically No Where to? ？
SQL And NoSQL
SQL It refers to the structured query language of database , It's the command set of database operation , Traditional relational databases use standard SQL Statement operations handle data .
NoSQL It refers to a kind of database , It is mainly used for high performance processing of super massive data , One of its characteristics is that the data structure is simple , With
key-value Mainly , There's no correlation between data , Easy to do horizontal expansion .
Literally ,NoSQL It seems to be related to SQL Antagonistic , do NoSQL It seems to mean giving up SQL, But in fact NoSQL The original intention is Not Only SQL, It's not just SQL, Then it can include SQL The ability of .
DCache It's based on TARS Distributed framework development NoSQL The storage system , Data is stored in memory , At the same time, it supports back-end connection DB Data persistence , Combined with the NoSQL and SQL The advantages of , It has the following characteristics
- High performance storage engine , Support
key-value（ Key value pair ）,
k-k-row（ Multi key value ）,
list（ list ）,
set（ aggregate ）,
zset（ Ordered set ） And other data structures ;
- Adopt cluster mode , Achieve high scalability and high availability , Support remote image , Access nearby ;
- Supported by TARS Name Service Access , Support synchronization 、 asynchronous 、 A one-way RPC Call mode ;
- Efficient operation and maintenance platform , Complete service deployment online 、 Expansion and contraction capacity 、 transfer , And service configuration , Service call quality monitoring ;
- Business need not and directly and MySQL Interaction , DCache It will automatically slow down DB.
More about DCache Information about , You can see DCache Of GitHub Warehouse .
So next , Let's see how to TARS Up-mount deployment DCache.
Environment depends on
DCache be based on TARS Development , So before compiling and installing , You need to install TARS frame , For specific installation steps, please refer to TARS Framework deployment document .
Compiling and constructing
First the DCache The source code is cloned
git clone https://github.com/Tencent/DCache.git
Then enter the DCache Catalog , Execute the following command to compile build
mkdir build cd build cmake .. make make release make tar
After execution, it can generate DCache Release packages for services in .
After generating the release package , The next step is to DCache Deployed in TARS It's in . This step , We use it directly DCache The auto deployment script in the .
We just need to go ahead and compile the build project
build Catalog , Fill in the parameters , Just execute the installation script
cd build ../deploy/install.sh $TARS_MYSQL_IP $TARS_MYSQL_PORT $TARS_MYSQL_USER $TARS_MYSQL_PASSWORD $DCACHE_MYSQL_IP $DCACHE_MYSQL_PORT $DCACHE_MYSQL_USER $DCACHE_MYSQL_PASSWORD $CREATE $WEB_HOST $WEB_TOKEN $NODE_IP
The definitions of the parameters are as follows
TARS_MYSQL_IP: TARS Database IP;
TARS_MYSQL_PORT: TARS Port of the database ;
TARS_MYSQL_USER: TARS The user name of the database ;
TARS_MYSQL_PASSWORD: TARS Database password ;
DCACHE_MYSQL_IP: DCache Database IP;
DCACHE_MYSQL_PORT: DCache Port of the database ;
DCACHE_MYSQL_USER: DCache The user name of the database ;
DCACHE_MYSQL_PASSWORD: DCache Database password ;
CREATE: Whether to recreate DCache The database of , by
trueThen recreate ; If already created , For example, you need to upgrade the original DCache, It can be set to
false, Avoid recreating ;
WEB_HOST: TarsWeb Platform address ;
WEB_TOKEN: TarsWeb platform Token ( Need to go to web platform , On the user center , Create a Token);
NODE_IP: Public service deployment node IP, After deployment , You can TarsWeb The platform is expanded to multiple node computers .
../deploy/install.sh 192.168.1.123 3306 tarsAdmin [email protected] 192.168.1.124 3306 root 123456 192.168.1.123:3000 abcdefg1randomtoken12345 192.168.1.123
TARS And DCache The database can be the same , But if used in a formal environment , It is recommended to use them separately , by DCache Build an independent database .
After execution ,DCache Installation is complete , Here's the picture .
establish DCache application
installed DCache, We can create the first DCache Applied .
First, we need to add an area , Used to identify the DCache application . Click on the top
Service creation , Click below Tab Column
region , Click on
New areas , Fill in the area and label , for example
Shenzhen , label
sz, as follows
After creation , Click on Tab Column
Create an , Fill in the application name , And choose one IDC region , Click on
Create an . Let's create a
TestDemo application , Regional choice
Shenzhen , as follows
Router Configuration information in , choice
service IP, And fill in the MySQL Instance information ;
Proxy Configuration information in , Select the proxy service
service IP, Click on
establish router、proxy service Complete the application creation .
Last , Click on
Install release , You can publish the app
After publishing , go back to
Service management , Refresh to see the DCache application
We'll show you how to deploy the caching module in this application in the next article , And in TARS Use in service , Coming soon .
This article briefly introduces DCache Characteristics of , And detailed how to install DCache And create a DCache application , Help developers quickly deploy 、 Get started DCache. About DCache The creation and use of service modules , It will be introduced in the following series , Do please look forward to .
TARS The system can be built quickly and the code can be generated automatically while considering the ease of use and high performance , Help developers and enterprises to quickly build their own stable and reliable distributed applications in the way of microservices , This allows developers to focus only on business logic , Improve operational efficiency . Multilingual 、 Agile R & D 、 The features of high availability and efficient operation make TARS Become an enterprise class product .
TARS Microservices help you with digital transformation , Welcome to visit ：
TARS Official website ：https://TarsCloud.org
TARS Source code ：https://github.com/TarsCloud
Linux The foundation official micro service free course ：https://www.edx.org/course/bu...
obtain 《TARS Official training eBook 》：https://wj.qq.com/s2/6570357/...
Or scan code to obtain ：