In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Introduction
The first website project that many Internet application developers come into contact with is the blog system. Wordpress, which is the most widely used in the world, is often used by users to quickly build personal blog sites. By default, Wordpress generally uses a MySQL relational database to store all blog posts and responses in the background. This article will show how to replace MySQL with SequoiaDB Giant Sequoia distributed database and become the background relational database of Wordpress blog system.
By reading this article, you can learn how to use the MySQL instance of the SequoiaDB sequoia database to seamlessly replace the standard MySQL database. SequoiaDB Giant Sequoia database allows users to migrate background MySQL databases to existing applications directly without changing a single line of code.
By using the SequoiaDB Giant Sequoia database, users can get:
Horizontal elastic expansion of
100% fully compatible with MySQL
's excellent trading performance
WordPress is a blog platform developed in PHP language. Users can set up their own websites on servers that support PHP and MySQL databases, and they can also use WordPress as a content management system (CMS).
WordPress has many free templates developed by third parties and is easy to install and use. At the same time, WordPress officially supports the Chinese version, and has thousands of plug-ins and countless theme template styles.
Install SequoiaDB
In this paper, Linux Ubuntu Server 18.10 is used as the server, and the version of SequoiaDB sequoia database is 3.2.1.
By default, this tutorial uses the sudo username and password as "sequoiadb:sequoiadb" and the default home path as / home/sequoiadb.
For users using other versions of Linux, such as CentOS, the process described in this article may be slightly different and needs to be adjusted according to the actual situation.
1) download and install SequoiaDB Giant Sequoia Database
$wget http://cdn.sequoiadb.com/images/sequoiadb/x86_64/sequoiadb-3.2.1-linux_x86_64.tar.gz
$tar-zxvf sequoiadb-3.2.1-linux_x86_64.tar.gz
$cd sequoiadb-3.2.1/
$sudo. / setup.sh
After that, enter all the time to confirm the default parameters.
2) use database instance users to create default instances
$sudo su sdbadmin
$/ opt/sequoiadb/tools/deploy/quickDeploy.sh
3) Connect to the database and enable the transaction function and set the default isolation level RC
$/ opt/sequoiadb/bin/sdb
Db = new Sdb ()
Db.updateConf ({transactionon: true, transisolation: 1})
Quit
$/ opt/sequoiadb/bin/sdbstop
$/ opt/sequoiadb/bin/sdbstart
Install Apache and PHP
Update the system package and install Apache and PHP
$sudo apt-get update
$sudo apt-get install apache2 php libapache2-mod-php php-mysql unzip php-xml
Install Wordpress
This tutorial uses Wordpress 5.2.1.
1) Log in to the Wordpress official website download page https://wordpress.org/download/releases/
Or log in to the sequoiadb user and download the installation package using wget
$wget https://wordpress.org/wordpress-5.2.1.tar.gz
2) install Wordpress and configure
$tar-zxvf wordpress-5.2.1.tar.gz
$cd wordpress
$sudo rm / var/www/html/
$sudo cp-R / var/www/html/
$sudo cp / var/www/html/wp-config-sample.php / var/www/html/wp-config.php
$sudo chown www-data:www-data / var/www/html/*
3) change the configuration file
$sudo vi / var/www/html/wp-config.php
Define ('DB_NAME',' database_name_here'); change to define ('DB_NAME',' wordpress')
Define ('DB_USER',' username_here'); change to define ('DB_USER',' sequoiadb')
Define ('DB_PASSWORD',' password_here'); change to define ('DB_PASSWORD',' sequoiadb')
Define ('DB_HOST',' localhost'); becomes define ('DB_HOST',')
4) create Wordpress database
$sudo su sdbadmin
$/ opt/sequoiasql/mysql/bin/mysql-S / opt/sequoiasql/mysql/database/3306/mysqld.sock-u root
Mysql > create user 'sequoiadb'@'localhost' identified by' sequoiadb'
Mysql > create database wordpress
Mysql > grant all on wordpress. To 'sequoiadb'@'localhost'
Mysql > grant all privileges on. * to 'sequoiadb'@'%' identified by' sequoiadb' with grant option
Mysql > exit
5) confirmation tables are scattered in multiple partitions
$/ opt/sequoiadb/bin/sdb
Db=new Sdb ()
Db.snapshot (SDB_SNAP_CATALOG)
……
{
"_ id": {
"$oid": "5cecf121116eae6117df17dc"
}
"Name": "wordpress.wp_posts"
"UniqueID": 4294967308
"Version": 1
"ReplSize":-1
"Attribute": 1
"AttributeDesc": "Compressed"
"CompressionType": 1
"CompressionTypeDesc": "lzw"
"ShardingKey": {
"ID": 1
}
"EnsureShardingIndex": false
"ShardingType": "hash"
"Partition": 4096
"InternalV": 3
"CataInfo": [
{
"ID": 0
"GroupID": 1000
"GroupName": "group1"
"LowBound": {
"": 0
}
"UpBound": {
"": 1365
}
}
{
"ID": 1
"GroupID": 1001
"GroupName": "group2"
"LowBound": {
"": 1365
}
"UpBound": {
"": 2730
}
}
{
"ID": 2
"GroupID": 1002
"GroupName": "group3"
"LowBound": {
"": 2730
}
"UpBound": {
"": 4096
}
}
]
"AutoSplit": true
"AutoIncrement": [
{
"SequenceName": "SYS_4294967308_ID_SEQ"
"Field": "ID"
"Generated": "default"
"SequenceID": 11
}
]
}
……
The CataInfo field for each table is the consistent hash range of the table scattered in different partitions, and the partition key is the ShardingKey field. For wp_posts, its table structure shows that the data is hashed and divided according to the ID field, and the data is scattered into the three partitions of the cluster.
Configure Wordpress
1) Log in to the server IP address through the browser
Site Title: SDBWordpress
Username: sequoiadb
Password: sequoiadb
Select Confirm use of weak password
Your Email: test@test.com
clicks the Install WordPress button to get the successful installation interface.
2) Log in with sequoiadb:sequoiadb as the username and password
3) change the desktop theme
4) go back to the home page of the Wordpress blog and try to change the content of the blog or add comments
After simply editing the article
Conclusion
As a distributed database, SequoiaDB sequoia database provides mechanisms including structured SQL, unstructured file system and object storage.
The MySQL instance created by SequoiaDB can provide SQL and DDL capabilities that are fully compatible with standard MySQL, and users can access the distributed table structure seamlessly and transparently without adjusting DDL or SQL.
This article shows readers how to migrate seamlessly with standard MySQL through the MySQL instance of SequoiaDB. By using SequoiaDB Giant Sequoia database, users can achieve nearly unlimited elastic scalability on the basis of meeting the standard ACID and MySQL protocols.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.