"Linux Beginner" mongdb, database MySQL installation (iv)

Source: Internet
Author: User
Tags file copy mysql client

First, the installation of Linux under Mongdb

1. Download the installation package

wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz

Unzip the package after download is complete

TAR-ZXVF mongodb-linux-i686-1.8.2.tgz

2. Installation Preparation

Move MongoDB to the/usr/local/mongdb folder

MV bin/mongodb-linux-i686-1.8.2/* mongodb/

Create database folder with log file (here is logs file, non-folder)



3. Set up boot from boot

Add MongoDB Startup Project to Rc.local to ensure MongoDB starts when the server is powered on

echo "/usr/local/server/bin/mongod--dbpath=/usr/local/mongodb/data–logpath=/usr/local/mongodb/logs–logappend-- auth–port=27017 ">>/etc/rc.local

4. Start MongoDB

CD to the Bin folder under the MongoDB directory to start MongoDB

The following is a login method that requires permissions, user name and password required for connection

/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--logpath=/usr/local/mongodb/logs--logappend-- port=27017--fork

If you perform an error:

(1)-bash:/usr/local/mongodb/bin/mongod:/lib/ld-linux.so.2:bad ELF interpreter:no such file or directory, Workaround: Execute yum I Nstall ld-linux.so.2

(2)/usr/local/mongodb/bin/mongod:error while loading shared libraries:libstdc++.so.6:cannot open Shared object File:no Such file or directory, workaround:

Run the Yum whatprovides libstdc++.so.6 first (see which package contains the library) and print as follows:

[email protected] bin]# Yum whatprovides libstdc++.so.6
Loaded Plugins:fastestmirror, security
Loading mirror speeds from cached hostfile
* Base:mirrors.btte.net
* Extras:mirrors.btte.net
* updates:mirror.neu.edu.cn
libstdc++-4.4.7-16.el6.i686 : GNU standard C + + Library
Matched from:

Then execute: Yum install libstdc++-4.4.7-16.el6.i686

(3) Also tip: Protected multilib versions:libstdc++-4.4.7-16.el6.i686! = libstdc++-4.4.7-3.el6.x86_64
You could try using--skip-broken to work around the problem
You could try Running:rpm-va--nofiles--nodigest, the workaround:

Yum Update libstdc++-4.4.7-3.el6.x86_64

All issues resolved ~ ~ Start MongoDB again

5. Parameter explanation: (Take a look and see)

--dbpath database path (data file)

--logpath log file path

--master designated as the main machine

--slave specified as Slave machine

--source Specify the IP address of the host machine

--POLOGSIZE specifies that the log file size does not exceed 64M. Because Resync is very large and time-consuming, it is best to avoid resync by setting a sufficiently large oplogsize (the default oplog size is 5% of the size of the free disk).

--logappend log file End add

--port Enable port numbers

--fork running in the background

--ONLY specifies which database to replicate only

--slavedelay refers to the time interval from which replication is detected

--auth If you need to verify permissions login (username and password)

-H [--help] Show this usage information

--version Show version Information

-F [--config] arg configuration file specifying additional options

--port Arg Specify port number

--BIND_IP arg local IP address to bind Listener-all local IPs

Bound by default

-V [--verbose] is more verbose (include multiple times for more

verbosity e.g.-VVVVV)

--dbpath Arg (=/data/db/) directory for datafiles specifies the data storage directory

--quiet Quieter output Silent mode

--logpath arg file to send all output to instead of stdout specify log storage directory

--logappend APPND to LogPath instead of over-writing Specifies whether the log is written to the log file in append or overwrite mode

--fork Fork Server process runs in a way that creates a child process

--CPU periodically show CPU and iowait utilization periodic display of CPU and IO usage

--noauth run without security no authentication mode operation

--auth run with security authentication mode

--objcheck inspect client data for validity on receipt check validity check

--quota Enable DB Quota management start management of database quotas

--quotafiles arg number of files Allower per db, requires--quota rules per database allowed

--appsrvpath arg root directory for the Babble app server

--nocursors diagnostic/debugging option Debug Diagnostics options

--nohints Ignore query hints ignores the search hit ratio

--nohttpinterface Disable HTTP interface off HTTP interface, default is 28017

--noscripting Disable scripting engine close script engines

--noprealloc Disable data file preallocation to close the size pre-allocation of database files

--smallfiles use a smaller default file size uses a smaller

--nssize Arg (=16). ns file Size (in MB) The default size for new database NS files in the databases

--diaglog arg 0=off 1=w 2=r 3=both 7=w+some reads is provided in a way that is read-only, write-only, or read-write, or the main write + part of the reading mode

--sysinfo Print Some diagnostic system Information printing systems diagnostic information

--upgrade upgrade DB If needed update database if needed

--repair Run Repair on all DBS repair all databases

--notablescan do not allow table scans does not run tables scan

--syncdelay Arg (=60) seconds between disk syncs (0 for never) the system synchronizes the time to flush disks by default is 60s

Replication options:

--master Master Mode primary Copy mode

--slave slave mode from replication

--source Arg when slave:specify master as <server:port> specifies the primary address and port when it is from

--only Arg when slave:specify a single database to replicate is specified from the primary copy

--pairwith arg address of server to pair with

--arbiter arg address of arbiter server arbiter, used in master and pair

--autoresync automatically resync if slave data is stale auto-sync from

--oplogsize arg size limit (in megabytes) for OP log specifies the sizes of the operation logs

--opidmem arg size limit (in bytes) for in memory storage of OP IDs specifies the amount of memory to store the operation log

6. CLI management interface into the database

CD to the Bin folder under the MongoDB directory, execute the command./mongo

Run as follows:

[Root@namenode mongodb]#./bin/mongo

MongoDB Shell version:1.8.2

Connecting To:test

> Use test;

Switched to DB test

Sharding options:

--configsvr Declare this is a config db of a cluster specify the configuration server in Shard

--shardsvr declare this is a shard db of a cluster specifies the Shard server

Second, the database MySQL installation: (using the official compiled binary file installation, the advantage is the installation speed, installation steps simple, the disadvantage is that the installation package is large, about 300M)

    1. Official website: http://dev.mysql.com/downloads/mysql/#downloads, on the download page select Platform: Option Linux-generic, then pull the page to the bottom, 64-bit system download linux-generic (GLIBC 2.5) (x86, 64-bit), 32-bit system download linux-generic (GLIBC 2.5) (x86, 32-bit)

    2. TAR-ZXVF mysql-5.6.17-linux-glibc2.5-i686.tar.gz

Cp-r bin/mysql-5.6.26-linux-glibc2.5-x86_64/* mysql/

3. Add the system MySQL group and the MySQL User:

Execute command: Groupadd MySQL and useradd-r-g MySQL MySQL

4. Go to install MySQL software directory: Execute command cd/usr/local/mysql

Modify current directory owner for MySQL User: Execute command chown-r mysql:mysql.

Install database: Executes the command./scripts/mysql_install_db--user=mysql (initialization scripts can only be performed in the installation directory)

Modify the current directory owner as root User: Execute command chown-r root:root.

Modify the current data directory owner for MySQL User: Execute command chown-r mysql:mysql data

To this database installation is complete

5. Start the MySQL service and add the boot MySQL service:

Add Boot: Execute command CP Support-files/mysql.server/etc/init.d/mysql, put startup script into boot initialization directory

Start MySQL service: Execute command service MySQL start

Execute command: Ps-ef|grep MySQL

6. Change the root password of MySQL, the root initial password is empty:

Execute command:./bin/mysqladmin-u root password ' password '

7. Place the MySQL client in the default path:


Note: It is recommended to use the soft chain in the past, do not directly package file copy, easy to install multiple versions of MySQL system

"Linux Beginner" mongdb, database MySQL installation (iv)

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.