Upgrade python2 to python3

  1. 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).

  2. Tar -zxf python-3.2.3. TGZ Decompress package

  3. yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc libffi-devel Install required dependencies

  4. CD Python – 3.7.3

  5. . / configure — prefix = / usr/local/python3 compilation

  6. Make && make install

  7. Mv /usr/bin/python /usr/bin/python.bak Indicates the backup system python2

  8. Ln -s/usr/local/python3 / bin/python3 / usr/bin/python -f soft connection is established

  9. Ln -s/usr/local/python3 / bin/pip3 / usr/bin/PIP -f soft connection is established

  10. Python -v To view the version

  11. Vim /usr/bin/yum converts the #! The/usr/bin/python to #! The/usr/bin/python2.7

  12. Vim /usr/libexec/urlgrabber-ext-down replaces the #! The/usr/bin/python to #! The/usr/bin/python2.7

  13. 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

  1. 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

  1. Your computer to download artifacts. Elastic. Co/downloads/e… , and then through XFTP into the server, the location of the file to choose.

  2. Tar -xzvf ElasticSearch Decompressed

  3. Vim./elasticsearch-7.2.0/config config file  

Setting environment variables

  1. vim ~/.bash_profileThe last four exports correspond to the mongoDB bin directory, elasticSearch bin directory, JDK root directory, and all environment variables exported.
  2. 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:

  1. Mkdir mongodb1 in any file directory

  2. cd mongodb1

  3. mkdir data

  4. mkdir logs

  5. mkdir conf

  6. cd conf

  7. 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
  8. 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

  1. 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
  2. pip install mongo-connector

  3. pip install elastic2-doc-manager

  4. Start a Mongod

  5. mongo

  6. rs.initiate()

  7. rs.conf()

  8. rs.status()

  9. Exit the mongo

  10. 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)

  11. There should then be a mongo-connector.log file in the current directory.

  12. 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

At this point we are done with mongo data synchronization to Elasticsearch