-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathinit.sh
executable file
·48 lines (35 loc) · 1.78 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Wait until Solr is ready
#until wait-for-it.sh solr:8983 ";" ; do
# echo "Waiting on MySQL init..."
# sleep 5
#done
#echo "Sleeping 15"
#sleep 15
./wait-for-solr.sh --max-attempts 10 --wait-seconds 4 --solr-url http://solr:8983
echo "Uploading security.json to ZK"
java -jar ./jackhanna-0.0.4-SNAPSHOT.jar zookeeper:2181 putfile --file security.json --zkFile /security.json
#/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost zookeeper:2181 -cmd putfile /security.json /code/security.json
sleep 5 #give ZK chance to sync with Solr first
#echo "Creating admin user"
#curl --user solr:SolrRocks http://solr:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{
# "set-user": {"admin" : "3YnRnaMk7sLbc","user" : "3YnRnaMk7sLbc"}
#}'
#echo "Creating new roles"
#curl --user solr:SolrRocks http://solr:8983/solr/admin/authorization -H 'Content-type:application/json' -d '{
# "set-user-role": {"admin":["admin","dev"]},
# "set-user-role": {"user":["admin","dev"]}
#}'
#echo "Deleting default Solr user"
#curl --user admin:3YnRnaMk7sLbc http://solr:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{
# "delete-user": ["solr"]}'
echo "Creating documents collection...."
curl --user solr:SolrRocks "http://solr:8983/solr/admin/collections?action=CREATE&name=documents&collection.configName=configuration1&numShards=2&maxShardsPerNode=2" #place holder
echo "Sleeping 5"
sleep 5
echo "Load all the extracts"
./load_sample_files.sh /docs_for_solr http://solr:8983/solr/documents/update
#./load_sample_files.sh /docs_for_solr2 http://solr:8983/solr/documents/update
./load_sample_files.sh /docs_for_solr3 http://solr:8983/solr/documents/update
./load_sample_files.sh /docs_for_solr4 http://solr:8983/solr/documents/update
echo "Done with setup"