suse12.1-mysql5.7 MongoDB RPM Deployment

Source: Internet
Author: User
Tags install mongodb mongodb version


http://dev.mysql.com/downloads/mysql/http://blog.csdn.net/gaolu/article/details/52090174http:// haowen.blog.51cto.com/3486731/1274721 MySQL:http://dev.mysql.com/downloads/repo/suse/--Download URL


1. Verify that the old version or application of MySQL is installed



# rpm-qa|grep MySQL


2. Uninstall the old version or apply #rpm-ev libqt4-sql-mysql-4.8.6-2.6.x86_643, update the Zypper library (Adding the MySQL SLES Repository) # wget/http repo.mysql.com//mysql57-community-release-sles12-7.noarch.rpm---wget http://repo.mysql.com// mysql57-community-release-sles11-7.noarch.rpm--SUSE11---# RPM-UVH mysql57-community-release-sles12-7.noarch.rpm# Zypper repos|grep mysql.*community* This installation mysql57-community if not yes you need to use the following command


# zypper Repos-e |grep mysql57-community



* Using the following command is forbidden



# sudo zypper modifyrepo-d mysql57-community


* Use the following command is allowed # sudo zypper modifyrepo-e mysql57-community# sudo zypper refresh4, install MySQL 5.7 Server (installing MySQL with Zy Pper) # sudo zypper install MYSQL-COMMUNITY-SERVER5, initialize configuration MySQL 5.7 (starting the MySQL Server)


# sudo service MySQL stop



# sudo service MySQL start



-----



Error:


# vim/var/log/mysql/mysqld.log2016-10-08t02:48:46.797210z 0 [ERROR] Could not open UNIX socket lock file/var/lib/mysql/m ysql.sock.lock.2016-10-08t02:48:46.797227z 0 [ERROR] Unable to setup UNIX socket lock file.2016-10-08t02:48:46.797243z 0 [ERROR] Aborting


Solve:

rm /var/lib/mysql/mysql.sock
rm /var/lib/mysql/mysql.sock.lock
You can change the password like this --- skip the authorization
Modify my.cnf configuration file
# sudo vi /etc/my.cnf
Add a sentence to the [mysqld] section: skip-grant-tables, as follows:
[mysqld]
datadir = / var / lib / mysql
socket = / var / lib / mysql / mysql.sock
skip-grant-tables
Restart the service
# sudo systemctl restart mysqld
Login and change password
# mysql -uroot
mysql> use mysql
MySQL 5.7.6 and the latest version:
mysql> update user set authentication_string = PASSWORD (‘rzrk123456’) where User = ‘root’;
MySQL 5.7.5 or earlier versions:
# mysql> update user set password = PASSWORD (‘newpass’) where User = ‘root’;
Login test
Modify the settings of my.cnf back, restart MySQL service, and log in to test:
-----

* Query the random password generated when installing the system

# grep "password" /var/log/mysql/mysqld.log

2016-09-27T07: 45: 58.815397Z 1 [Note] A temporary password is generated for [email protected]: zrp = hfIo & 3VF # mysql -uroot -p --The password is the random password queried mysql> show databases; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. --- Report error * Initial password, password complexity error mysql> set password = PASSWORD ('rzrk123'); ERROR 1819 (HY000): Your password does not satisfy the current policy requirements * Modify password complexity value: 0orLOW mysql> set global validate_password_policy = 0; Query OK, 0 rows affected (0.00 sec)
* Modify the initial password;

mysql> SET PASSWORD = PASSWORD (‘rzrk123456’); --- Red is the password

success! ! References: http://www.th7.cn/db/Oracle/201606/192025.shtml Change the database storage path: 1. Check the mysql database storage directory # mysql -uroot -przrk123456 mysql> show variables like '% dir%' ; + ----------------------------------------- + ------ ------------------------- + | Variable_name | Value | + ------------------ ----------------------- + -------------------------- ----- + | basedir | / usr / | | binlog_direct_non_transactional_updates | OFF | | character_sets_dir | / usr / share / mysql / charsets / | | datadir | / home / rzrk / server / data / mysql / | | ignore_db_dirs | | | innodb_data_home_dir | | | innodb_log_group_home_dir | ./ | | innodb_max_dirty_pages_pct 75.000000 | | innodb_max_dirty_pages_pct_lwm | 0.000000 | | innodb_tmpdir | | | innodb_undo_directory | ./ | | lc_messages_dir | / usr / share / mysql / | | plugin_dir | / usr / lib64 / mysql / plugin / | | slave_load_tmpdir | / tmp | + ----------------------------------------- + --- ---------------------------- + 2. Stop the mysql service 3. Create a new database storage directory 4. Move the previous directory file to New catalog file
cp -R / var / lib / mysql / * / home / rzrk / server / data / mysql

chown mysql: mysql / home / rzrk / server / data / mysql -R vim /etc/my.cnf datadir = / home / rzrk / server / data / mysql restart mysql service reproduced from http://www.cnblogs.com/ mazhiqing / p / 6572946.html MongoDB (11) Install MongoDB Community Edition initialization script on SUSE
The mongodb-org package contains various initialization scripts, including the initialization script /etc/rc.d/init.d/mongod. You can use this script to stop, start, and restart the daemon.

This package uses the /etc/mongod.conf file to configure MongoDB and is used in conjunction with the initialization script. For documentation of the configurations available in the configuration file, see the configuration file reference.

As of version 3.2.10, there will be no mongos initialization script. Mongos is only used for sharding. You can change the mongod initialization script used to a mongos initialization script available for your environment. For configuration details, see mongos reference.

The package provided by the default /etc/mongod.conf configuration file has bind_ip, and the default setting is 127.0.0.1. Before initializing the replica set, your environment needs to modify this configuration.

note:
The virtual memory address space of SUSE Linux Enterprise Server and potentially other SUSE distributions is limited to 8GB by default. You must adjust this parameter to prevent virtual memory allocation failure as the database grows.
MongoDB's SLES package adjusts these limits in the initialization script, but if you are using a custom script or compressed package distribution instead of the SLES package, you will need to manually change these limits.

Install MongoDB Community Edition
Note:
For MongoDB versions prior to 3.2, please refer to the specified version documentation. For example, see version 3.0.

This installation tutorial only supports 64-bit operating systems. For details, please refer to Platform Support.

1. Configure the software package management system (zypper).
Add a repository so you can install MongoDB using zypper.

Version 3.0 changes: The MongoDB Linux package has a new repository since 3.0.

For the latest stable version of MongoDB

Run the appropriate command for your SUSE version:

SUSE 11

sudo zypper addrepo --no-gpgcheck "https://repo.mongodb.org/zypper/suse/11/mongodb-org/3.2/x86_64/" mongodb
SUSE 12

sudo zypper addrepo --no-gpgcheck "https://repo.mongodb.org/zypper/suse/12/mongodb-org/3.2/x86_64/" mongodb
For MongoDB versions earlier than 3.0

To install packages from an earlier version series, such as 3.0, you can specify the release version series from the repository configuration. For example, to restrict the SUSE 11 system to the 3.0 version series, use the following command:

sudo zypper addrepo --no-gpgcheck https://repo.mongodb.org/zypper/suse/11/mongodb-org/3.0/x86_64/ mongodb
2. Install the MongoDB software package and related tools.
When installing the package, you can choose to install the current version or the previous version. Both commands are provided in this step.

To install the latest stable version of MongoDB, please execute the following command:

sudo zypper -n install mongodb-org
Install a specific version of MongoDB, specify each component package individually, and append the version number to the package name, as shown in the following example:

sudo zypper install mongodb-org-3.2.10 mongodb-org-server-3.2.10 mongodb-org-shell-3.2.10 mongodb-org-mongos-3.2.10 mongodb-org-tools-3.2.10
You can specify any available MongoDB version. However, when a newer version is available, yum will upgrade the package. To prevent accidental upgrades, lock the package by running the following command,

sudo zypper addlock mongodb-org-3.2.10 mongodb-org-server-3.2.10 mongodb-org-shell-3.2.10 mongodb-org-mongos-3.2.10 mongodb-org-tools-3.2.10
Previous MongoDB package versions used different repository locations. Please refer to the documentation for your version of MongoDB.

Run MongoDB Community Edition Prerequisites
The MongoDB instance stores its data files and / var / lib / mongo by default Store its log files in / var / log / mongodb and run it with the mongod account. You can specify the log records and data file directories in /etc/mongod.conf. See systemLog.path and storage.dbPath for more information.

If you change the user who runs the MongoDB process, you must modify the access control permissions on the / var / lib / mongo and / var / log / mongodb directories to grant this user access to these directories.

Procedure 1. Start MongoDB.
You can issue the following command to start the mongod process:

sudo service mongod start
2. Verify that MongoDB starts successfully
You can read a line in /var/log/mongodb/mongod.log, and check whether the mongod process starts successfully by checking the contents of the log file

[initandlisten] waiting for connections on port <port>
Where <port> is the port configured in /etc/mongod.conf, the default is 27017.

You can set MongoDB to start automatically by executing the following command:

sudo chkconfig mongod on
3. Stop MongoDB.
As needed, you can stop the mongod process with the following command:

sudo service mongod stop
4. Restart MongoDB.
You can restart the mongod process with the following command:

sudo service mongod restart
You can pay attention to process status errors or important messages by viewing the output of the /var/log/mongodb/mongod.log file

5. Start using MongoDB.
To help you get started with MongoDB, MongoDB provides introductory tutorials for various driver versions. Please refer to the introductory available versions.

Before deploying MongoDB in a production environment, please consider the documentation of production considerations.

Later, stop MongoDB and press Ctrl + C in the terminal where the mongod instance is running.

Uninstall MongoDB Community Edition
To completely remove MongoDB from the system, you must delete the MongoDB application itself, configuration files, and any directories that contain data and logs. The following sections will guide you through the necessary steps.

Warning: This process will completely delete MongoDB, its configuration and all databases. This process is irreversible, please make sure you have backed up all my configuration and data before proceeding.

1. Stop MongoDB.
Issue the following command to stop mongod:

sudo service mongod stop
2. Remove the software package.
Remove all MongoDB packages you installed earlier.

sudo zypper remove $ (rpm -qa | grep mongodb-org)
3. Delete the data directory.
Delete the MongoDB database and log files.

 
sudo rm -r / var / log / mongodb
sudo rm -r / var / lib / mongo
Suse12.1-mysql5.7 mongodb rpm deployment

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.