mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
up
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<p onclick="pluginInitD('solr');">自启动</p>
|
||||
<p onclick="collectionManagement();">管理</p>
|
||||
<p onclick="pluginLogs('solr','','run_log');">日志</p>
|
||||
<p onclick="pluginLogs('solr','','script_full');">全量同步脚本</p>
|
||||
<p onclick="pluginConfig('solr','','script_full');">全量分页脚本</p>
|
||||
<p onclick="pRead()">说明</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
|
||||
@@ -96,6 +96,12 @@ def initDreplace():
|
||||
public.writeFile(file_bin, content)
|
||||
public.execShell('chmod +x ' + file_bin)
|
||||
|
||||
file_py = initD_path + '/' + getPluginName() + '.py'
|
||||
if not os.path.exists(file_py):
|
||||
content = public.readFile(getPluginDir() + '/script/full.py')
|
||||
public.writeFile(file_py, content)
|
||||
public.execShell('chmod +x ' + file_py)
|
||||
|
||||
return file_bin
|
||||
|
||||
|
||||
@@ -241,9 +247,8 @@ def confFileCollection():
|
||||
return public.returnJson(True, 'OK', {'path': conf_file})
|
||||
|
||||
|
||||
|
||||
def scriptFull():
|
||||
return getPluginDir() + "/script/full.py"
|
||||
return getServerDir() + "/init.d/solr.py"
|
||||
|
||||
# rsyncdReceive
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -169,7 +169,7 @@ function cmdCollection(name){
|
||||
var cmd = '<div class="change-default pd20"><table class="table table-hover">';
|
||||
cmd += '<thead><tr><td>增量更新</td><td>curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=delta-import&wt=json&clean=false&commit=true"</td></tr>';
|
||||
cmd += '<tr><td>全量更新</td><td>curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=full-import&wt=json&clean=false&commit=true"<td></tr>';
|
||||
cmd += '<tr><td>全量分页更新</td><td>curl "http://127.0.0.1:8983/solr/'+name+'/dataimport?command=full-import&wt=json&clean=false&commit=true&length=100&offset=0"<td></tr>';
|
||||
cmd += '<tr><td>全量分页更新[计划任务]</td><td>python /www/server/solr/init.d/solr.py<td></tr>';
|
||||
cmd += '<tr><td colspan="2">默认端口:8983(可修改),默认IP为本地,可修改。</td></tr></thead>';
|
||||
cmd += '</table></div>';
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ def execShell(cmdstring, cwd=None, timeout=None, shell=True):
|
||||
return sub.communicate()
|
||||
|
||||
|
||||
for x in xrange(1, count / 10 + 1):
|
||||
for x in xrange(1, count / 100 + 1):
|
||||
y = x * 10
|
||||
cmd = 'curl --basic -u admin:admin "http://127.0.0.1:8983/solr/sodht/dataimport?command=full-import&wt=json&clean=false&commit=true&length=10&offset=' + \
|
||||
cmd = 'curl --basic -u admin:admin "http://127.0.0.1:8983/solr/sodht/dataimport?command=full-import&wt=json&clean=false&commit=true&length=100&offset=' + \
|
||||
str(y) + '"'
|
||||
print execShell(cmd)
|
||||
|
||||
Reference in New Issue
Block a user