MongoDB
[ MongoDB ] MongoDB Test Data
- -
반응형
몽고 DB의 성능을 테스트하기 위해 테스트 데이터를 입력하는 방법에 대해 기록하도록 하겠습니다.~~
■ wget sampledata
- 외부 에서 sample data를 받아 옵니다.
wget https://atlas-education.s3.amazonaws.com/sampledata.archive
■ mongodb tools 다운로드
- sample data를 몽고 DB에 넣기 위해서는 mongorestore tool이 필요
###mongodb tools 다운로드
[root@mongo ~]# vim /etc/yum.repos.d/mongodb-org-5.0.repo
[mongodb-org-5.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/5.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-5.0.asc
[root@mongo ~]# sudo yum install -y mongodb-org-tools
[root@mongo ~]# mongorestore --archive=sampledata.archive
2022-12-09T08:51:20.223+0900 preparing collections to restore from
2022-12-09T08:51:20.238+0900 reading metadata for sample_restaurants.restaurants from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_weatherdata.data from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_mflix.theaters from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_mflix.sessions from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_training.trips from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_training.grades from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_analytics.transactions from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_guides.planets from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_mflix.comments from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_mflix.movies from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_training.posts from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_supplies.sales from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_mflix.users from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_training.zips from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_analytics.accounts from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_airbnb.listingsAndReviews from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_training.companies from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_training.routes from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_training.inspections from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_analytics.customers from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_restaurants.neighborhoods from archive 'sampledata.archive'
2022-12-09T08:51:20.239+0900 reading metadata for sample_geospatial.shipwrecks from archive 'sampledata.archive'
2022-12-09T08:51:20.249+0900 restoring sample_mflix.comments from archive 'sampledata.archive'
2022-12-09T08:51:20.831+0900 finished restoring sample_mflix.comments (41079 documents, 0 failures)
2022-12-09T08:51:20.839+0900 restoring sample_training.routes from archive 'sampledata.archive'
2022-12-09T08:51:21.690+0900 finished restoring sample_training.routes (66985 documents, 0 failures)
2022-12-09T08:51:21.700+0900 restoring sample_training.zips from archive 'sampledata.archive'
2022-12-09T08:51:22.056+0900 finished restoring sample_training.zips (29470 documents, 0 failures)
2022-12-09T08:51:22.069+0900 restoring sample_training.inspections from archive 'sampledata.archive'
2022-12-09T08:51:22.970+0900 restoring sample_training.grades from archive 'sampledata.archive'
2022-12-09T08:51:23.175+0900 sample_training.inspections 16.0MB
2022-12-09T08:51:23.175+0900 sample_training.grades 3.34MB
2022-12-09T08:51:23.175+0900
2022-12-09T08:51:24.222+0900 sample_training.inspections 21.1MB
2022-12-09T08:51:24.222+0900 finished restoring sample_training.inspections (80047 documents, 0 failures)
2022-12-09T08:51:24.563+0900 restoring sample_restaurants.restaurants from archive 'sampledata.archive'
2022-12-09T08:51:25.004+0900 sample_training.grades 22.2MB
2022-12-09T08:51:25.004+0900 finished restoring sample_training.grades (100000 documents, 0 failures)
2022-12-09T08:51:25.009+0900 finished restoring sample_restaurants.restaurants (25359 documents, 0 failures)
2022-12-09T08:51:25.018+0900 restoring sample_geospatial.shipwrecks from archive 'sampledata.archive'
2022-12-09T08:51:25.196+0900 finished restoring sample_geospatial.shipwrecks (11095 documents, 0 failures)
2022-12-09T08:51:25.205+0900 restoring sample_mflix.movies from archive 'sampledata.archive'
2022-12-09T08:51:25.546+0900 restoring sample_training.trips from archive 'sampledata.archive'
2022-12-09T08:51:25.716+0900 finished restoring sample_training.trips (10000 documents, 0 failures)
2022-12-09T08:51:25.754+0900 restoring sample_weatherdata.data from archive 'sampledata.archive'
2022-12-09T08:51:26.031+0900 restoring sample_training.companies from archive 'sampledata.archive'
2022-12-09T08:51:26.172+0900 sample_mflix.movies 16.0MB
2022-12-09T08:51:26.172+0900 sample_weatherdata.data 16.0MB
2022-12-09T08:51:26.172+0900 sample_training.companies 10.4MB
2022-12-09T08:51:26.172+0900
2022-12-09T08:51:26.277+0900 sample_weatherdata.data 16.1MB
2022-12-09T08:51:26.277+0900 finished restoring sample_weatherdata.data (10000 documents, 0 failures)
2022-12-09T08:51:26.737+0900 sample_mflix.movies 36.1MB
2022-12-09T08:51:26.737+0900 finished restoring sample_mflix.movies (23530 documents, 0 failures)
2022-12-09T08:51:26.745+0900 restoring sample_supplies.sales from archive 'sampledata.archive'
2022-12-09T08:51:26.843+0900 finished restoring sample_supplies.sales (5000 documents, 0 failures)
2022-12-09T08:51:26.890+0900 restoring sample_analytics.accounts from archive 'sampledata.archive'
2022-12-09T08:51:26.914+0900 finished restoring sample_analytics.accounts (1746 documents, 0 failures)
2022-12-09T08:51:27.191+0900 restoring sample_mflix.theaters from archive 'sampledata.archive'
2022-12-09T08:51:27.216+0900 restoring sample_airbnb.listingsAndReviews from archive 'sampledata.archive'
2022-12-09T08:51:27.254+0900 finished restoring sample_mflix.theaters (1564 documents, 0 failures)
2022-12-09T08:51:27.326+0900 sample_training.companies 34.8MB
2022-12-09T08:51:27.326+0900 finished restoring sample_training.companies (9500 documents, 0 failures)
2022-12-09T08:51:27.334+0900 restoring sample_analytics.transactions from archive 'sampledata.archive'
2022-12-09T08:51:27.524+0900 finished restoring sample_analytics.transactions (1746 documents, 0 failures)
2022-12-09T08:51:27.532+0900 restoring sample_analytics.customers from archive 'sampledata.archive'
2022-12-09T08:51:27.545+0900 finished restoring sample_analytics.customers (500 documents, 0 failures)
2022-12-09T08:51:27.554+0900 restoring sample_restaurants.neighborhoods from archive 'sampledata.archive'
2022-12-09T08:51:27.591+0900 finished restoring sample_restaurants.neighborhoods (195 documents, 0 failures)
2022-12-09T08:51:27.600+0900 restoring sample_mflix.users from archive 'sampledata.archive'
2022-12-09T08:51:27.614+0900 finished restoring sample_mflix.users (185 documents, 0 failures)
2022-12-09T08:51:27.622+0900 restoring sample_guides.planets from archive 'sampledata.archive'
2022-12-09T08:51:27.643+0900 finished restoring sample_guides.planets (8 documents, 0 failures)
2022-12-09T08:51:27.653+0900 restoring sample_mflix.sessions from archive 'sampledata.archive'
2022-12-09T08:51:27.674+0900 finished restoring sample_mflix.sessions (1 document, 0 failures)
2022-12-09T08:51:27.681+0900 restoring sample_training.posts from archive 'sampledata.archive'
2022-12-09T08:51:27.810+0900 finished restoring sample_training.posts (500 documents, 0 failures)
2022-12-09T08:51:28.916+0900 finished restoring sample_airbnb.listingsAndReviews (5555 documents, 0 failures)
2022-12-09T08:51:28.917+0900 no indexes to restore for collection sample_supplies.sales
2022-12-09T08:51:28.917+0900 restoring indexes for collection sample_airbnb.listingsAndReviews from metadata
2022-12-09T08:51:28.917+0900 index: &idx.IndexDocument{Options:primitive.M{"background":true, "name":"name_1", "v":2}, Key:primitive.D{primitive.E{Key:"name", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2022-12-09T08:51:28.917+0900 index: &idx.IndexDocument{Options:primitive.M{"2dsphereIndexVersion":3, "background":true, "name":"address.location_2dsphere", "v":2}, Key:primitive.D{primitive.E{Key:"address.location", Value:"2dsphere"}}, PartialFilterExpression:primitive.D(nil)}
2022-12-09T08:51:28.917+0900 index: &idx.IndexDocument{Options:primitive.M{"background":true, "name":"property_type_1_room_type_1_beds_1", "v":2}, Key:primitive.D{primitive.E{Key:"property_type", Value:1}, primitive.E{Key:"room_type", Value:1}, primitive.E{Key:"beds", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2022-12-09T08:51:28.917+0900 no indexes to restore for collection sample_restaurants.restaurants
2022-12-09T08:51:28.917+0900 no indexes to restore for collection sample_restaurants.neighborhoods
2022-12-09T08:51:28.917+0900 no indexes to restore for collection sample_weatherdata.data
2022-12-09T08:51:28.917+0900 no indexes to restore for collection sample_analytics.transactions
2022-12-09T08:51:28.917+0900 no indexes to restore for collection sample_analytics.accounts
2022-12-09T08:51:28.917+0900 restoring indexes for collection sample_geospatial.shipwrecks from metadata
2022-12-09T08:51:28.917+0900 index: &idx.IndexDocument{Options:primitive.M{"2dsphereIndexVersion":3, "background":true, "name":"coordinates_2dsphere", "v":2}, Key:primitive.D{primitive.E{Key:"coordinates", Value:"2dsphere"}}, PartialFilterExpression:primitive.D(nil)}
2022-12-09T08:51:28.917+0900 no indexes to restore for collection sample_analytics.customers
2022-12-09T08:51:28.917+0900 restoring indexes for collection sample_mflix.movies from metadata
2022-12-09T08:51:28.917+0900 index: &idx.IndexDocument{Options:primitive.M{"default_language":"english", "language_override":"language", "name":"cast_text_fullplot_text_genres_text_title_text", "textIndexVersion":3, "v":2, "weights":primitive.M{"cast":1, "fullplot":1, "genres":1, "title":1}}, Key:primitive.D{primitive.E{Key:"_fts", Value:"text"}, primitive.E{Key:"_ftsx", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2022-12-09T08:51:28.918+0900 no indexes to restore for collection sample_guides.planets
2022-12-09T08:51:28.918+0900 restoring indexes for collection sample_mflix.users from metadata
2022-12-09T08:51:28.918+0900 index: &idx.IndexDocument{Options:primitive.M{"name":"email_1", "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"email", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2022-12-09T08:51:29.014+0900 restoring indexes for collection sample_mflix.theaters from metadata
2022-12-09T08:51:29.014+0900 index: &idx.IndexDocument{Options:primitive.M{"2dsphereIndexVersion":3, "name":"geo index", "v":2}, Key:primitive.D{primitive.E{Key:"location.geo", Value:"2dsphere"}}, PartialFilterExpression:primitive.D(nil)}
2022-12-09T08:51:29.150+0900 restoring indexes for collection sample_mflix.sessions from metadata
2022-12-09T08:51:29.150+0900 index: &idx.IndexDocument{Options:primitive.M{"name":"user_id_1", "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"user_id", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2022-12-09T08:51:29.263+0900 no indexes to restore for collection sample_mflix.comments
2022-12-09T08:51:29.263+0900 no indexes to restore for collection sample_training.companies
2022-12-09T08:51:29.263+0900 no indexes to restore for collection sample_training.routes
2022-12-09T08:51:29.263+0900 no indexes to restore for collection sample_training.inspections
2022-12-09T08:51:29.263+0900 no indexes to restore for collection sample_training.trips
2022-12-09T08:51:29.263+0900 no indexes to restore for collection sample_training.grades
2022-12-09T08:51:29.263+0900 no indexes to restore for collection sample_training.posts
2022-12-09T08:51:29.263+0900 no indexes to restore for collection sample_training.zips
2022-12-09T08:51:33.085+0900 424065 document(s) restored successfully. 0 document(s) failed to restore.
- 테스트 데이터 확인
> show databases;
admin 0.000GB
config 0.000GB
db 0.000GB
local 0.000GB
sample_airbnb 0.050GB
sample_analytics 0.009GB
sample_geospatial 0.001GB
sample_guides 0.000GB
sample_mflix 0.043GB
sample_restaurants 0.006GB
sample_supplies 0.001GB
sample_training 0.040GB
sample_weatherdata 0.002GB
test 0.063GB
> show tables;
listingsAndReviews
반응형
'MongoDB' 카테고리의 다른 글
[ MongoDB ] MongoDB 접속 ( Use. Python ) (0) | 2022.12.16 |
---|---|
[MongoDB] - MongoDB Binary Install (0) | 2022.12.15 |
Contents
소중한 공감 감사합니다