LNMP + MEM + Redis architecture deployment (expansion)

Source: Internet
Author: User

Generally, the architecture deployment is in two formats: LNMP and LAMP. Here I am talking about LNMP architecture deployment, nginx, mysql, php, and memcache compilation configuration installation, mysql Master/Slave configuration and permission issues, background monitoring of nagio, cacti, zabbix introduction,

######################################## ##################################

Before deploying the architecture, install the necessary libraries,

Install required Libraries

Yum-y groupinstall "Development tools"

Yum install-y gcc-c ++ make cmake zlib-devel openssh openssl-devel net-snmp pcre-devel libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses-devel curl-devel kernel e2fsprogs-devel xinetd lrzsz dos2unix telnet python-devel mysql-devlibel XSLT-devel unixODBC-devel sqlite-devel

######################################## ##################################

Mysql compilation and installation and some extensions

1.1 mysql source code compilation and installation, Mysql 5.6.14

: Http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.14.tar.gz

Check whether mysql has been installed before,

Rpm-qa | grep mysql

If yes, delete it.

Rpm-e mysql // normal deletion Mode

Rpm-e -- nodeps mysql // strong deletion mode. If the above command is used to delete other dependent files, you can use this command to forcibly delete them.

Compile and install cmake. Install cmake first.

Yum-y install cmake

Cd/app

Groupadd mysql

Useradd mysql-g mysql

Mkdir-p/usr/local/mysq

Mkdir-p/app/mysql/data

Mkdir-p/app/mysql/log

Tar zxvf mysql-5.6.14.tar.gz

Cd mysql-5.6.14

Cmake \

-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \

-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \

-DDEFAULT_CHARSET = utf8 \

-DDEFAULT_COLLATION = utf8_general_ci \

-DWITH_MYISAM_STORAGE_ENGINE = 1 \

-DWITH_INNOBASE_STORAGE_ENGINE = 1 \

-DWITH_ARCHIVE_STORAGE_ENGINE = 1 \

-DWITH_BLACKHOLE_STORAGE_ENGINE = 1 \

-DWITH_MEMORY_STORAGE_ENGINE = 1 \

-DWITH_READLINE = 1 \

-DENABLED_LOCAL_INFILE = 1 \

-DMYSQL_DATADIR =/app/mysql/data \

-DMYSQL_USER = mysql \

-DMYSQL_TCP_PORT = 3306

Make

Make install

Make clean

Chown-R mysql: mysql/usr/local/mysql

Chown-R mysql: mysql/app/mysql/data

Chown-R mysql: mysql/app/mysql/log

 

Cd/usr/local/mysql

Scripts/mysql_install_db -- user = mysql -- datadir =/app/mysql/data

/Usr/local/mysql/bin/mysqld_safe &

Cp support-files/mysql. server/etc/init. d/mysql

Ln-s/usr/local/mysql/bin/mysql/usr/bin

Ln-s/usr/local/mysql/bin/mysql/usr/sbin

Chkconfig mysql on

Service mysql start

 

1.2 database account Permissions

Mysql gives permissions:

Grant permission on database. * username @ login host identified by "password"

Example: grant all on *. * to root@10.240.53.98 identified by "123456"

Refresh: fulsh privileges

1.3 Database Backup mysqldump

Export data using mysqldump

A. Only export the table structure

Mysqldump -- opt-d database name-u username-p password> xx. SQL

For example, mysqldump -- opt-d shop_data-u root-p admin> onlystruct_shop_data. SQL

B. Export data only

Mysqldump-t database name-u username-p password> xx. SQL

For example, mysqldump -- t shop_data-u root-p admin> onlydata_shop_data. SQL

C. Export all data and structures

Mysqldump database-u username-p password> xx. SQL

For example, mysqldump shop_data-u root-p admin> shop_data. SQL

D. Export a specific table

Mysqldump database-u username-p password-B -- table Name> xx. SQL

For example, mysqldump shop_data-u root-p admin-B -- table user> user. SQL

Default font format -- default-character-set = utf8

1.4 import data sources

Source import data

Source/home/root/XX. SQL can only be used after logging on to mysql-uroot-padmin

For example, source/home/root/test. SQL

1.5. Change the Database Password mysqladmin

Mysql password change:

Add the new password mysqladmin-uroot password

Old password Change New password: mysqladmin-uroot-p old password New password

  • 1
  • 2
  • 3
  • Next Page

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.