Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of solr online and offline core

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "what is the method of solr online and offline core". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Solr online and offline core

Sometimes we need to test shard when there is no replica. For example, the following situation.

Now we keep one copy of each shard.

We can use the unloud command

Offline

Http://slave3:8983/solr/admin/cores?action=UNLOAD&core=ZGCPWSWCORE2_shard1_replica2

Restart

Http://slave3:8983/solr/admin/cores?action=RELOAD&core=ZGCPWSWCORE2_shard1_replica2

It is found that the core cannot be found when it is restarted at this time. Note here that unload is not offline, but uninstalled. Indicates that the index has been uninstalled and deleted, such as in the following ways:

Create

Http://slave3:8983/solr/admin/cores?action=CREATE&name=ZGCPWSWCORE2_shard1_replica2&collection=ZGCPWSWCORE2&shard=shard1

At this point, he will automatically synchronize the index.

Question: our demand is to temporarily offline core, and then go online again later. Not delete, check the operation of core. Reference:

Http://blog.csdn.net/a925907195/article/details/45421529

There is an offline core in it.

6. Offline core

Official example: http://localhost:8983/solr/admin/cores?action=UNLOAD&core=core0

Optional parameters:

1. DeleteIndex: if true, will remove the index when unloading the core.

DeleteDataDir: if true, removes the data directory and all sub-directories.

DeleteInstanceDir: if true, removes everything related to the core, including the index directory, configuration files, and other related files.

Async: if set to a value, makes the call asynchronous. This call can then be tracked using the REQUESTSTATUS API.

Therefore, only by adding parameters will the data be deleted. We use

Http://slave3:8983/solr/admin/cores?action=UNLOAD&core=ZGCPWSWCORE2_shard1_replica2

Did not delete the data, must have made a sign to enter the management interface.

Upper right corner: Instance:/var/lib/solr/ZGCPWSWCORE2_shard2_replica2

When this node is not offline, enter this folder: enter ll

Drwxr-xr-x 2 solr solr 4096 May 16 15:51. /

Drwxr-xr-x 15 solr solr 4096 May 16 15:52.. /

-rw-r--r-- 1 solr solr 171 Mar 28 09:57 core.properties

Open core.properties

# Written by CorePropertiesLocator

# Mon Mar 28 09:57:27 CST 2016

NumShards=5

Name=ZGCPWSWCORE2_shard2_replica2

Shard=shard2

Collection=ZGCPWSWCORE2

CoreNodeName=core_node2

Information about this core. Now take this core offline:

Http://master:8983/solr/admin/cores?action=UNLOAD&core=ZGCPWSWCORE2_shard2_replica2

Enter / var/lib/solr/ZGCPWSWCORE2_shard2_replica2

You'll find out

Drwxr-xr-x 2 solr solr 4096 May 16 15:50. /

Drwxr-xr-x 15 solr solr 4096 Mar 30 16:19.. /

-rw-r--r-- 1 solr solr 171 Mar 28 09:57 core.properties.unloaded

A mark is made here, using mv core.properties.unloaded core.properties

Restart the solr service and you will find the core.

This is the end of the content of "what is the method of solr online and offline core". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report