In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In mongodb General use for viewing statistical information of a table: db.t.stats () main information is: "ns": "gqtest.t", "count": 40001, # rows "size": 2188945, # data size unit bytes "storageSize": 1126400, "totalIndexSize": 1851392, # Total index size "indexSizes": {"_ id_": 753664, "age_1_name_1": 1097728} "avgObjSize": 54.72225694357641, "nindexes": 2, # Index number
Write the obtained table name in advance: college.txt file. Mainly through regular matching, you can test and adjust it yourself.
#! / bin/bashuser=adminpasswd=123456database=gqtestaddres=/opt/mongodb3.2.13/bin/mongofile=mongo_data.csvfor I in `cat roomge.txt` do college_name= `$addres-- port 7211-u$user-p$passwd-- authenticationDatabase=admin $database-- eval "db.$i.stats ()" | grep ns | awk 'NR==1 {print $3}' `count=` $addres-port 7211-u$user-p$passwd-authenticationDatabase=admin $database-eval "db.$i.stats ()" | grep count | awk 'NR==1 {print $3}' `size= `addres-port 7211-u$user-p$passwd-- AuthenticationDatabase=admin $database-- eval "db.$i.stats ()" | grep size | awk 'NR==1 {print $3}' `index_num= `$ addres-- port 7211-u$user-p$passwd-- authenticationDatabase=admin $database-- eval "db.$i.stats ()" | grep nindexes | awk 'NR==1 {print $3}' `indexsize= `$addres-port 7211-u$user-p$passwd-authenticationDatabase=admin $database-eval "db.$i.stats ()" | grep totalIndexSize | awk 'NR==1 {print $3}' `echo-e "$college_name $college_name $count $count $size\ n" > $size
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.