|
|
@ -10,11 +10,11 @@ import time |
|
|
|
sys.path.append("/usr/local/lib/python2.7/site-packages") |
|
|
|
sys.path.append("/usr/local/lib/python2.7/site-packages") |
|
|
|
|
|
|
|
|
|
|
|
conn = mdb.connect(host='0.0.0.0', |
|
|
|
conn = mdb.connect(host='0.0.0.0', |
|
|
|
port=3306, |
|
|
|
port=3306, |
|
|
|
user='xxx', |
|
|
|
user='xxx', |
|
|
|
passwd='xxx', |
|
|
|
passwd='xxx', |
|
|
|
db='xxx', |
|
|
|
db='xxx', |
|
|
|
charset='utf8') |
|
|
|
charset='utf8') |
|
|
|
conn.autocommit(True) |
|
|
|
conn.autocommit(True) |
|
|
|
cursor = conn.cursor() |
|
|
|
cursor = conn.cursor() |
|
|
|
|
|
|
|
|
|
|
@ -49,9 +49,8 @@ def execShell(cmdstring, cwd=None, timeout=None, shell=True): |
|
|
|
return sub.communicate() |
|
|
|
return sub.communicate() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for x in xrange(1,count/10+1): |
|
|
|
for x in xrange(1, count / 10 + 1): |
|
|
|
y = x * 10 |
|
|
|
y = x * 10 |
|
|
|
cmd = 'curl --basic -u admin:admin "http://176.122.138.146:8983/solr/sodht/dataimport?command=full-import&wt=json&clean=false&commit=true&length=10&offset='+str(y)+'"' |
|
|
|
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=' + \ |
|
|
|
print execShell(cmd) |
|
|
|
str(y) + '"' |
|
|
|
|
|
|
|
print execShell(cmd) |
|
|
|
|
|
|
|
|
|
|
|