How to install Infobright in CentOS 6.6

Source: Internet
Author: User
Tags anonymous character set mysql client centos create database server port

Infobright is based on mysql, but it does not support mysql, because it comes with. Mysql can be roughly divided into the logic layer and the physical storage engine. infobright mainly implements a storage engine, but because its own storage logic is basically different from that of relational databases, it cannot be directly attached to mysql as the plug-in InnoDB. Its logic layer is the logic layer of mysql and its own Optimizer.


Infobright is a very powerful columnar storage database, which has been introduced in previous articles. This is mainly the installation record for Infobright. There may be omissions in the middle for further improvement.

Since the official Infobright has provided the rpm package, it is relatively simple to install:


Cd/usr/local/src
Wget http://www.infobright.org/downloads/ice/infobright-4.0.7-0-x86_64-ice.rpm
Rpm-ivh infobright-4.0.7-0-x86_64-ice.rpm

By default, infobright is installed to/usr/local/infobright-4.0.7-0-x86_64, and you can specify the installation directory by adding the-prefix parameter, such:

Rpm-ivh infobright-4.0.7-0-x86_64-ice.rpm -- prefix =/usr/local/infobright

This will install to/usr/local/infobright/infobright-4.0.7-0-x86_64.

For the entire installation process, it is quite simple and tedious to set relevant parameters:

A. Configure the memory size.

Vim/usr/local/infobright-4.0.7-x86_64/data/brighthouse. ini

You can modify the memory configuration according to the recommended values:


########### Critical Memory Settings ############
# System Memory Server Main Heap Size Server Compressed Heap Size Loader Main Heap Size
#32 GB 24000 4000 800
#16 GB 10000 1000 800
#8 GB 4000 500 800
#4 GB 1300 400 400
#2 GB 600 250 320
B. Built-in system configuration functions

Sh/usr/local/infobright-4.0.7-x86_64/postconfig. sh

This script can change the configuration of datadir, cachedir, socket, port, and so on. It needs to be executed by the root user. The information returned after execution is as follows: (if no modification is required, all N is required)

Infobright post configuration
--------------------------------------
Using postconfig you can:
--------------------------------------
(1) Move existing data directory to other location,
(2) Move existing cache directory to other location,
(3) Configure server socket,
(4) Configure server port,
(5) Relocate datadir path to an existing data directory.
 
Please type 'Y' for option that you want or press ctrl + c for exit.
 
Current configuration:
 
--------------------------------------
Current config file: [/etc/my-ib.cnf]
Current brighthouse. ini file: [/usr/local/infobright-4.0.7-x86_64/data/brighthouse. ini]
Current datadir: [/usr/local/infobright-4.0.7-x86_64/data]
Current CacheFolder in brighthouse. ini file: [/usr/local/infobright-4.0.7-x86_64/cache]
Current socket: [/tmp/mysql-ib.sock]
Current port: [5029]
--------------------------------------
 
(1) Do you want to copy current datadir [/usr/local/infobright-4.0.7-x86_64/data] to a new location? [Y/n]: n
(2) Do you want to move current CacheFolder [/usr/local/infobright-4.0.7-x86_64/cache] to a new location? [Y/n]: n
(3) Do you want to change current socket [/tmp/mysql-ib.sock]? [Y/n]: n
(4) Do you want to change current port [5029]? [Y/n]: n
(5) Do you want to relocate to an existing datadir? Current datadir is [/usr/local/infobright-4.0.7-x86_64/data]. [y/n]: n
 
--------------------------------------
--------------------------------------
No changes has been made.
--------------------------------------
C. Set character sets

Infobright does not support Chinese by default. To better support Chinese, you need to set the default character set.

Vim/etc/my-ib.cnf

Find the following content:

Collation_server = latin1_bin
Character_set_server = latin1

Modify it:

Collation_server = utf8_bin
Character_set_server = utf8

D. Install the startup script

Cp/usr/local/infobright-4.0.7-x86_64/share/mysql. server/etc/init. d/mysqld-ib
Vim/etc/init. d/mysqld-ib

Find the following two lines of code:

Conf = @ BH_CONF @
User = @ BH_USER @

To:


Conf =/etc/my-ib.cnf
User = mysql

Mysql users are used in the preceding configuration file. After the configuration is complete, determine whether the mysql User actually exists:

Cat/etc/passwd | grep mysql

If not, add the user as follows:

Groupadd mysql
Useradd-s/sbin/nologin-g mysql

Next, start infobright.

/Etc/init. d/mysql-ib start

The system cannot be started. The following information is displayed ,:

Starting MySQL/etc/init. d/mysqld-ib: line 175: lsb_release: command not found
... ERROR!

To solve the problem above, perform the following operations:


Yum install-y redhat-lsb

An error still exists after the restart command is re-executed:


Starting MySQL ...... [FAILED]

View error logs:

Cat/usr/local/infobright-4.0.7-x86_64/data/bh. err

The error log contains the following content:


150312 18:20:15 [ERROR] Fatal error: Can't change to run as user 'mysql'; Please check that the user exists!
It is preliminarily determined that mysql has no permission and may be installed with root. The specific modification permission is not available for the moment. The temporary solution is to modify/etc/init. the user in the d/mysqld-ib file is root and can run normally after modification.

Other related commands:


/Etc/init. d/mysqld-ib stop
/Etc/init. d/mysqld-ib restart

Add boot start:

Chkconfig -- add mysqld-ib

E. Mysql security settings

PATH = $ PATH:/usr/local/infobright-4.0.7-x86_64/bin
Mysql_secure_installation

After the command is executed, the boot page of the relevant settings will be displayed:


NOTE: running all parts of this script is recommended for all MySQL
Servers in production use! Please read each step carefully!
 
 
In order to log into MySQL to secure it, we'll need the current
Password for the root user. If you 've just installed MySQL, and
You haven't set the root password yet, the password will be blank,
So you shoshould just press enter here.
 
Enter current password for root (enter for none ):
OK, successfully used password, moving on...
 
Setting the root password ensures that nobody can log into the MySQL
Root user without the proper authorisation.
 
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables ..
... Success!
 
 
By default, a MySQL installation has an anonymous user, allowing anyone
To log into MySQL without having to have a user account created
Them. This is intended only for testing, and to make the installation
Go a bit smoother. You shoshould remove them before moving into
Production environment.
 
Remove anonymous users? [Y/n] y
... Success!
 
Normally, root shoshould only be allowed to connect from 'localhost'. This
Ensures that someone cannot guess at the root password from the network.
 
Disallow root login remotely? [Y/n] y
... Success!
 
By default, MySQL comes with a database named 'test' that anyone can
Access. This is also intended only for testing, and shocould be removed
Before moving into a production environment.
 
Remove test database and access to it? [Y/n] y
-Dropping test database...
... Success!
-Removing privileges on test database...
... Success!
 
Reloading the privilege tables will ensure that all changes made so far
Will take effect immediately.
 
Reload privilege tables now? [Y/n] y
... Success!
 
Cleaning up...
 
 
 
All done! If you 've completed all of the above steps, your MySQL
Installation shoshould now be secure.
 
Thanks for using MySQL!

After that, add a remote connection account to mysql and run the following command to access the mysql client:

Mysql-uroot-p

After adding a remote user, follow these steps:


Grant all privileges on *. * TO 'infobright '@' % 'identified by 'password' with grant option;
Flush privileges;

Now the configuration is complete. You can use SQLyog to try the connection.


Create database 'dw 'character SET utf8 COLLATE utf8_bin;
 
Create table 'dw '. 'Dim _ Day' ('datekey' INT, 'caldate' DATE, 'calyear' INT, 'calquarter 'VARCHAR (8), 'calmonth' INT, 'calweek' VARCHAR (8), 'calday' INT, 'Holiday 'VARCHAR (8), 'earquarter' VARCHAR (8), 'earmonth' INT) ENGINE = brighthouse charset = utf8 COLLATE = utf8_bin;
 
Load data local infile 'C: \ Users \ biaodianfu \ Desktop \ dim_day.csv 'into TABLE 'dw '. 'Dim _ day' character set 'utf8' fields escaped by '\ 'terminated by', 'lines terminated by' \ n' ('datekey', 'caldate ', 'calyear', 'calquarter ', 'calmonth', 'calweek', 'calday', 'Holiday', 'earquarter ', 'yearmonth ');
To avoid Chinese garbled characters, character sets are required for both database creation, table creation, and data import.

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.