Configure bare devices for Linux UDEV and MySQL InnoDB shared tablespace

Source: Internet
Author: User

Configure bare devices for Linux UDEV and MySQL InnoDB shared tablespaces (1) UDEV basic udev can manage files stored in the/dev directory. Files are generated only after the device is connected. automatic deletion also allows you to add rules to modify the default name and permissions in/dev, and save the rules in/etc/udev/rules. d/directory (2) bind MySQL to bare devices only InnoDB can use bare devices. Advantages: bypassing the file system improves read/write speeds, in addition, the data is relatively safe, the file system burden is reduced, and the system performance is also improved. Disadvantages: Too secure, A lot of backup tools may not work, dd can consider the following describes how to bind a bare device (I) to the mysql shared tablespace to create a bare Device

     # fdisk /dev/sda     ==> /dev/sda5     # partprobe     # fdisk -l     # pvcreate /dev/sda5     # vgcreate -s 16M mysqlvg /dev/sda5     # lvcreate -L 90M -n sharespace mysqlvg     # vim /etc/sysconfig/rawdevices      ==> /dev/raw/raw1  /dev/mysqlvg/sharespace     # service rawdevices start     # chkconfig rawdevices on     # chown -R mysql:dba /dev/mapper/mysqlvg-sharespace

 

(Ii) Configure MySQL ① To specify the newraw attribute
        innodb_data_home_dir =        innodb_data_file_path = /dev/mapper/mysqlvg-sharespace:60Mnewraw

 

② Restart the mysql service. After completing partition initialization, disable mysql service ③ modify the raw attribute
        innodb_data_home_dir =        innodb_data_file_path = /dev/mapper/mysqlvg-sharespace:60Mraw

 

④ Restart the mysql service. If the whole system is restarted and the permissions of bare devices are revoked, the official website of mysql cannot be enabled. The descriptions are as follows:
[plain] will fail after the next reboot, if the /dev-tree is dynamically created by, e.g. udev, a MAKEDEV-script or similar.   After reboot, the device will regain its former permission, typically excluding access by mysql.  

 

The alert alarm is as follows:
[plain] 130719 20:42:43  InnoDB: Operating system error number 13 in a file operation.  InnoDB: The error means mysqld does not have the access rights to  InnoDB: the directory.  InnoDB: File name /dev/mapper/mysqlvg-sharespace  InnoDB: File operation call: 'open'.  InnoDB: Cannot continue operation.  

 

In this case, the options are as follows: 1) write a simple initialization script and automatically authorize upon restart. 2) Configure udev entries,
[plain] [root@odd rules.d]# pwd  /etc/udev/rules.d    [root@odd rules.d]# cat 60-raw.rules    ACTION=="add", KERNEL=="sda5", GROUP=="dba", MODE=="0660", RUN+="/bin/raw /dev/raw/raw1 %N"  [root@odd rules.d]# cat 65-raw-permissions.rules    KERNEL=="sda5", GROUP="dba", MODE="0660"  

 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.