Skip to content

Commit

Permalink
Test: remove port param from mongoimport
Browse files Browse the repository at this point in the history
  • Loading branch information
nikodemas committed Dec 19, 2023
1 parent 931b517 commit 7eba1d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rucio-dataset-monitoring/spark/cron4rucio_hdfs2mongo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function run_mongo_import() {
hadoop fs -getmerge "$hdfs_out_dir"/part-*.json "$local_json_merge_file"

mongoimport --drop --type=json \
--host "$ARG_MONGOHOST" --port "$ARG_MONGOPORT" --username "$ARG_MONGOUSER" --password "$ARG_MONGOPASS" \
--host "$ARG_MONGOHOST" --username "$ARG_MONGOUSER" --password "$ARG_MONGOPASS" \
--authenticationDatabase "$ARG_MONGOAUTHDB" --db "$ARG_MONGOWRITEDB" \
--collection "$collection" --file "$local_json_merge_file"
util4logi "Mongoimport finished. ${hdfs_out_dir} imported to collection: ${collection}"
Expand All @@ -105,7 +105,7 @@ run_mongo_import "${HDFS_PATH}/${hdfs_datasets_in_tape_and_disk}" "$col_datasets
# Write current date to json file and import it to MongoDB "source_timestamp" collection for Go Web Page.
echo "{\"createdAt\": \"$(date +%Y-%m-%d)\"}" >source_timestamp.json
mongoimport --drop --type=json \
--host "$ARG_MONGOHOST" --port "$ARG_MONGOPORT" --username "$ARG_MONGOUSER" --password "$ARG_MONGOPASS" \
--host "$ARG_MONGOHOST" --username "$ARG_MONGOUSER" --password "$ARG_MONGOPASS" \
--authenticationDatabase "$ARG_MONGOAUTHDB" --db "$ARG_MONGOWRITEDB" \
--collection "source_timestamp" --file source_timestamp.json

Expand All @@ -115,7 +115,7 @@ util4logi "source_timestamp collection is updated with current date"
# Modify JS script
sed -i "s/_MONGOWRITEDB_/$ARG_MONGOWRITEDB/g" "$script_dir"/createindexes.js

mongosh --host "$ARG_MONGOHOST" --port "$ARG_MONGOPORT" --username "$ARG_MONGOUSER" --password "$ARG_MONGOPASS" \
mongosh --host "$ARG_MONGOHOST" --username "$ARG_MONGOUSER" --password "$ARG_MONGOPASS" \
--authenticationDatabase "$ARG_MONGOAUTHDB" <"$script_dir"/createindexes.js
util4logi "MongoDB indexes are created for datasets and detailed_datasets collections"

Expand Down

0 comments on commit 7eba1d7

Please sign in to comment.