Upgrade python2 to python3
-
Your computer through www.python.org/ftp/python/… Download Python3 and pass it into the server using XFTP (XFTP and Xshell are free: download by link).
-
Tar -zxf python-3.2.3. TGZ Decompress package
-
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc libffi-devel Install required dependencies
-
CD Python – 3.7.3
-
. / configure — prefix = / usr/local/python3 compilation
-
Make && make install
-
Mv /usr/bin/python /usr/bin/python.bak Indicates the backup system python2
-
Ln -s/usr/local/python3 / bin/python3 / usr/bin/python -f soft connection is established
-
Ln -s/usr/local/python3 / bin/pip3 / usr/bin/PIP -f soft connection is established
-
Python -v To view the version
-
Vim /usr/bin/yum converts the #! The/usr/bin/python to #! The/usr/bin/python2.7
-
Vim /usr/libexec/urlgrabber-ext-down replaces the #! The/usr/bin/python to #! The/usr/bin/python2.7
-
PIP install — Upgrade PIP Upgrade PIP
The installation of JDK1.8.0
This article reprinted: blog.csdn.net/u010590120/…
The Node version of the original system is too early. You need to upgrade the Node version
This article reprinted: segmentfault.com/a/119000001…
Install the mongo
-
Vim /etc/ymp.repos. D /mongodb-org-3.4.repo
[mongo - org - 3.4] name = directing a Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/ gpgcheck = 0 enabled = 1 gpgkey=https://www.mongodb.org/static/pgp/server-3.4.ascCopy the code
支那
2. Yum -y install mongodb-org
Install the Elasticsearch
-
Your computer to download artifacts. Elastic. Co/downloads/e… , and then through XFTP into the server, the location of the file to choose.
-
Tar -xzvf ElasticSearch Decompressed
-
Vim./elasticsearch-7.2.0/config config file
Setting environment variables
- vim ~/.bash_profileThe last four exports correspond to the mongoDB bin directory, elasticSearch bin directory, JDK root directory, and all environment variables exported.
- Source ~/.bash_profile makes the environment variable take effect immediately
Open the Mongo replica set
Multiple mongodb services can be enabled. The specific process is as follows:
-
Mkdir mongodb1 in any file directory
-
cd mongodb1
-
mkdir data
-
mkdir logs
-
mkdir conf
-
cd conf
-
Touch mongo.conf Creates a configuration file
Port port dbpath = = 27017 / / / home/LCC/mongodb1 / data / / data storage address logpath = / home/LCC/mongodb1 / logs/mongod log fork = / / log store address True // Background start bind_IP =0.0.0.0 // IP address replSet = rs0 // Copy set nameCopy the code
-
Mongod –config followed by step 7 conf configuration file directory
To start multiple Mongod services, create MongoDB2 and repeat the steps above
Synchronize mongo data to ElasticSearch
-
First we need to create the same index for Elasticsearch as one of our mongo tables and set the mapping. The following code block:
// Create index await client.indices. Create ({index: 'questions'}); / / index of the mapping set, must take the index after Es7 version, values and the table name consistent await client. Indices. PutMapping ({index: 'questions', include_type_name:true, type:'questions', body: {properties: {// table set id: {type:' long'}, date: { type: 'date' }, contents: { type: 'text', analyzer: 'ik_max_word' }, } } });Copy the code
-
pip install mongo-connector
-
pip install elastic2-doc-manager
-
Start a Mongod
-
mongo
-
rs.initiate()
-
rs.conf()
-
rs.status()
-
Exit the mongo
-
Mongo-connector -m 127.0.0.1:27017 -t 127.0.0.1:9200 -d elastic2_doc_manager -n Table names (e.g. Questions. Questions)
-
There should then be a mongo-connector.log file in the current directory.
-
Vim mongo-connector.log check to see if there is an error.
About the installation of IK participles
Github.com/medcl/elast… There are plug-in installation tutorials:
Use the /bin/elasticSearch-plugin in ES installer to install elasticSearch-plugin
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.2.0/elasticsearch-analysis-ik-7.2.0.zip
Copy the code