Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ Mongo-connector integrated MongoD to achieve incremental Solr index     - ntop monitoring software configuration and installation (Linux)

- Cygwin install Python MySQLdb (Linux)

- Computer black magic: tail recursion (Programming)

- top command causes the system load increases (Linux)

- Linux Open coredump (Linux)

- To install PXE + Kickstart under CentOS 6.x operating system (Linux)

- PostgreSQL 9.3.2 Json type of use (Database)

- Ubuntu system safe and caution sudo su command (Linux)

- Build your own CA services: OpenSSL command line CA Quick Guide (Server)

- NAT (network address translation) Realization (Linux)

- Deb package installation method under ubuntu (Linux)

- IP configuration under Linux (Linux)

- A list of the basics of Python, Ganso, Dictionary (Programming)

- VNC connection VMware vSphere ESXi 5.5 (Linux)

- STL in the list of erase () method (Programming)

- C # Future: Tracking null reference (Programming)

- Through Oracle to help restore MySQL data problems (Database)

- Docker study notes (Server)

- Puppet installation and testing (Server)

- CentOS 6.5 start ActiveMQ being given to solve (Server)

  Mongo-connector integrated MongoD to achieve incremental Solr index
  Add Date : 2017-04-13      
  Configure MongoDB replication set

Deployment and development of a test set for replication

Deployment replication set

1. The establishment of the necessary data for each node of the folder:

1 mkdir -p / srv / mongodb / rs0-0 / srv / mongodb / rs0-1 / srv / mongodb / rs0-2

2. the following command to start mongod instance:

The first node:

mongod --port 27017 --dbpath / srv / mongodb / rs0-0 --replSet rs0 --smallfiles --oplogSize 128 --logappend --logpath /srv/mongodb/rs0-0/mongod.log &

The second node:

mongod --port 27018 --dbpath / srv / mongodb / rs0-1 --replSet rs0 --smallfiles --oplogSize 128 --logappend --logpath /srv/mongodb/rs0-1/mongod.log &

Third node:

mongod --port 27019 --dbpath / srv / mongodb / rs0-2 --replSet rs0 --smallfiles --oplogSize 128 --logappend --logpath /srv/mongodb/rs0-2/mongod.log &

3. We may be connected by the following commands to the first instance:

mongo --port 27017

4. Use rs.initiate in the mongo () to initialize the replication set. We can adopt the following ways to set replication set configuration objects:

rsconf = {
          _id: "rs0",
          members: [
                      _id: 0,
                      host: "< hostname>: 27017"

5. replace < hostname> host name for our

rs.initiate (rsconf)

6. Check the replication set configuration

rs.conf ()

7. Use mongo connected to the primary, and used rs.add () command to add a second and third mongod instance to the replication set. Will replace < hostname> host name for us.

rs.add ( "< hostname>: 27018")
rs.add ( "< hostname>: 27019")

8. By rs.status () command to check the status of replication set.

Install mongo-connector

Method one: Install pip

1 pip install mongo-connector

Ython installed under the default package directory:


Method two: Install as a service

1. go https://github.com/mongodb-labs/mongo-connector/archive/master.zip download mongo-connector-master.zip.

2. Unzip into the directory.

unzip mongo-connector-master.zip
cd mongo-connector-master

3. Edit the configuration file.

vi config.json

4. Install as a service.

python setup.py install_service

In the /etc/init.d created under the mongo-connector service, and copy the files to config.json /etc/mongo-connector.json.

Uninstall mongo-connector service

python setup.py uninstall_service

It will remove /etc/init.d/mongo-connector and /etc/mongo-connector.json

Check the service status

service mongo-connector status

Configuration Solr

In Solr data directory / data / solr / data / Solr configuration files under solr.xml

Create core

su - solr -c "/ usr / local / solr / solr / bin / solr create -c card -n data_driven_schema_configs"

Generated folder / data / solr / data / card, in the / data / solr / data / card / conf directory is the card's configuration directory, you can configure synonyms, stop words.

Configuration solrconfig.xml

1. Make sure that enabled LukeRequestHandler

Application of the following line appears in solrconfig.xml file.

< RequestHandler name = "/ admin / luke" class = "org.apache.solr.handler.admin.LukeRequestHandler" />

2. Configure hard to submit (to refresh frequency on the hard disk) and soft submission (submitted to the memory frequency)

In solrconfig.xml configuration file < autoCommit> and < autoSoftCommit>

< AutoCommit>
< MaxTime> 300000 < / maxTime>
< MaxDocs> 10000 < / maxDocs>
< OpenSearcher> true < / openSearcher>
< / AutoCommit>
< -! SoftAutoCommit is like autoCommit except it causes a
'Soft' commit which only ensures that changes are visible
but does not ensure that data is synced to disk. This is
faster and more near-realtime friendly than a hard commit.
< AutoSoftCommit>
< MaxDocs> 1000 < / maxDocs>
< MaxTime> 60000 < / maxTime>
< / AutoSoftCommit>

Configuration schema.xml

1. Mongo Connector store metadata to help deal with the rollback in each document. To support these data, you need to add the following information to your schema.xml in:

< Field name = "_ ts" type = "long" indexed = "true" stored = "true" />
< Field name = "ns" type = "string" indexed = "true" stored = "true" />

2. Configuration < uniqueKey> in the schema.xml, < field>

Start mongo-connector

Method One: Start from the command line

nohup sudo mongo-connector -m localhost: 27019 -t http: // localhost: 8983 / solr / card -o oplog_progress.txt -n example.card -u _id -d solr_doc_manager> mongo-connector.out 2> & 1

Method Two: The service starts

service mongo-connector start

Solr to delete all indexes*:*%3C/query%3E%3C/delete%3E&stream.contentType=text/xml ; charset = utf-8 & commit = true
- Linux file time Comments ctime mtime atime (Linux)
- RHEL5 establish a local yum source (Linux)
- Java rewrite the hashcode method (Programming)
- Shell script on the variables with double quotation marks grep small problem (Programming)
- How to configure MongoDB replica set (Database)
- MySQL monitoring tools -orzdba (Database)
- Ubuntu 14.10 PPA installed Android Studio (Linux)
- Install Open vSwitch under CentOS 6.5 (Linux)
- Installation on the way to the root source Ubuntu Server 14.04 LTS version Odoo8.0 (Server)
- Get basic information about Linux server script (Server)
- Efficient Linux Shell - Shell special characters Summary (Linux)
- Struts2 configure a static resource files without Struts processing (regular match) (Programming)
- Preliminary understanding of SELinux security management (Linux)
- Oracle inverted reverse function (Database)
- SecureCRT in Python scripting study guide (Programming)
- Struts2 interceptor simulation (Programming)
- Linux command binlog by filtering out the complete SQL statement (Database)
- CentOS 7.0 Close firewall is enabled by default iptables firewall (Linux)
- JavaScript original values and complex values (Programming)
- init level settings for Linux / etc / inittab file into six (restart) or does not support the level of solution (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.