Mongodb build is huge - mongodb

I need to build mongodb from source to get SSL support.
I ran the following set of commands as per various sources I could find:
sudo git clone git://github.com/mongodb/mongo.git
cd mongo/
git checkout r2.6.0
sudo git checkout r2.6.0
sudo scons --ssl all
This builds without major issues (although it takes a long time) but the output files are huge:
-rwxr-xr-x 1 root root 361M May 2 12:28 bsondump
-rwxr-xr-x 1 root root 148M May 1 15:07 mongo
-rwxr-xr-x 1 root root 359M May 2 12:54 mongobridge
-rwxr-xr-x 1 root root 365M May 2 10:30 mongod
-rwxr-xr-x 1 root root 362M May 2 11:21 mongodump
-rwxr-xr-x 1 root root 361M May 2 11:40 mongoexport
-rwxr-xr-x 1 root root 362M May 2 12:21 mongofiles
-rwxr-xr-x 1 root root 361M May 2 11:48 mongoimport
-rwxr-xr-x 1 root root 361M May 2 12:13 mongooplog
-rwxr-xr-x 1 root root 358M May 2 12:35 mongoperf
-rwxr-xr-x 1 root root 362M May 2 11:30 mongorestore
-rwxr-xr-x 1 root root 248M May 2 11:07 mongos
-rwxr-xr-x 1 root root 362M May 2 11:57 mongostat
-rwxr-xr-x 1 root root 361M May 2 12:04 mongotop
-rwxr-xr-x 1 root root 361M May 2 12:46 perftest
-rwxr-xr-x 1 root root 455M May 2 14:54 test
Am I missing something here?

The raw build produces binaries that contain the debug symbols and you can get rid of them by using the strip command like this:
strip mongod

Related

How do you use tar to unzip a file in a dockerfile when using FROM perl

I'm trying to make a Docker container for a perl script, CooVar, but seem to be running into issues because the tar command is not available.
Dockerfile
FROM perl:5.20
RUN mkdir /tmp/install
WORKDIR /tmp/install
# Install cpan modules
RUN cpanm install Cwd Getopt::Long POSIX File::Basename List::Util Bio::DB::Fasta Bio::Seq Bio::SeqUtils Bio::SeqIO Set::IntervalTree Set::IntSpan
# Download CooVar-v0.07
RUN wget -O /usr/local/bin/CooVar-0.07.tar.gz http://genome.sfu.ca/projects/coovar/CooVar-0.07.tar.gz
RUN tar xvf /usr/local/bin/CooVar-0.07.tar.gz
# Set WORKDIR to /data -- predefined mount location.
RUN mkdir /data
WORKDIR /data
# And clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/install
# Set Entrypoint
ENTRYPOINT ["perl", "/usr/local/bin/coovar-0.07/coovar.pl"]
Note: I think the use of an Entrypoint here is preventing me from exploring a Docker containers file system via docker exec -t -i mycontainer /bin/bash but that's not a big issue as i think I know the problem from the error below.
Error
When I run this from Snakemake I was including ls /usr/bin so I can see what was in the container (very new to Dockerand not sure the best way to develop/debug yet). You can see that the.tar.gzwas not unzipped so it looks liketar` is not working in this case.
drwxrwxr-x 2 root root 2137 Oct 10 12:36 .
drwxrwxr-x 10 root root 147 May 5 2016 ..
-rw-r--r-- 1 root root 176772 Nov 20 2012 CooVar-0.07.tar.gz
-rwxr-xr-x 1 root root 112680 May 5 2016 a2p
-rwxr-xr-x 1 root root 2861 Oct 10 12:35 bp_aacomp
-rwxr-xr-x 1 root root 3696 Oct 10 12:35 bp_bioflat_index
-rwxr-xr-x 1 root root 1605 Oct 10 12:35 bp_biogetseq
-rwxr-xr-x 1 root root 2803 Oct 10 12:35 bp_dbsplit
-rwxr-xr-x 1 root root 2866 Oct 10 12:35 bp_extract_feature_seq
-rwxr-xr-x 1 root root 4002 Oct 10 12:35 bp_fastam9_to_table
-rwxr-xr-x 1 root root 7385 Oct 10 12:35 bp_fetch
-rwxr-xr-x 1 root root 1809 Oct 10 12:35 bp_filter_search
-rwxr-xr-x 1 root root 15121 Oct 10 12:35 bp_find-blast-matches
-rwxr-xr-x 1 root root 3427 Oct 10 12:35 bp_gccalc
-rwxr-xr-x 1 root root 79742 Oct 10 12:35 bp_genbank2gff3
-rwxr-xr-x 1 root root 4617 Oct 10 12:35 bp_index
-rwxr-xr-x 1 root root 1877 Oct 10 12:35 bp_local_taxonomydb_query
-rwxr-xr-x 1 root root 3239 Oct 10 12:35 bp_make_mrna_protein
-rwxr-xr-x 1 root root 4898 Oct 10 12:35 bp_mask_by_search
-rwxr-xr-x 1 root root 3041 Oct 10 12:35 bp_mrtrans
-rwxr-xr-x 1 root root 4292 Oct 10 12:35 bp_mutate
-rwxr-xr-x 1 root root 927 Oct 10 12:35 bp_nexus2nh
-rwxr-xr-x 1 root root 3533 Oct 10 12:35 bp_nrdb
-rwxr-xr-x 1 root root 6331 Oct 10 12:35 bp_oligo_count
-rwxr-xr-x 1 root root 7317 Oct 10 12:35 bp_process_gadfly
-rwxr-xr-x 1 root root 3752 Oct 10 12:35 bp_process_sgd
-rwxr-xr-x 1 root root 24416 Oct 10 12:35 bp_revtrans-motif
-rwxr-xr-x 1 root root 4190 Oct 10 12:35 bp_search2alnblocks
-rwxr-xr-x 1 root root 12519 Oct 10 12:35 bp_search2gff
-rwxr-xr-x 1 root root 2455 Oct 10 12:35 bp_search2table
-rwxr-xr-x 1 root root 2739 Oct 10 12:35 bp_search2tribe
-rwxr-xr-x 1 root root 1779 Oct 10 12:35 bp_seq_length
-rwxr-xr-x 1 root root 2289 Oct 10 12:35 bp_seqconvert
-rwxr-xr-x 1 root root 3833 Oct 10 12:35 bp_seqcut
-rwxr-xr-x 1 root root 4595 Oct 10 12:35 bp_seqpart
-rwxr-xr-x 1 root root 2339 Oct 10 12:35 bp_seqret
-rwxr-xr-x 1 root root 1549 Oct 10 12:35 bp_seqretsplit
-rwxr-xr-x 1 root root 4291 Oct 10 12:35 bp_split_seq
-rwxr-xr-x 1 root root 5912 Oct 10 12:35 bp_sreformat
-rwxr-xr-x 1 root root 3243 Oct 10 12:35 bp_taxid4species
-rwxr-xr-x 1 root root 2940 Oct 10 12:35 bp_taxonomy2tree
-rwxr-xr-x 1 root root 1624 Oct 10 12:35 bp_translate_seq
-rwxr-xr-x 1 root root 1488 Oct 10 12:35 bp_tree2pag
-rwxr-xr-x 1 root root 7504 Oct 10 12:35 bp_unflatten_seq
-rwxr-xr-x 2 root root 36619 May 5 2016 c2ph
-rwxr-xr-x 1 root root 7144 Oct 10 12:33 config_data
-rwxr-xr-x 1 root root 12804 May 5 2016 corelist
-rwxr-xr-x 1 root root 5873 May 5 2016 cpan
-rwxr-xr-x 1 root root 303998 May 5 2016 cpanm
-rwxr-xr-x 1 root root 41760 Oct 10 12:24 enc2xs
Anyone know how I can fix this Dockerfile?

daemonize-liquidsoap.sh not working

I've followed instructions here about installing liquid soap:
https://www.linuxjournal.com/content/creating-internet-radio-station-icecast-and-liquidsoap
This part I'm falling into difficulty:
$ git clone https://github.com/savonet/liquidsoap-daemon
$ cd liquidsoap-daemon
$ ./daemonize-liquidsoap.sh
It all works apart from:
$ ./daemonize-liquidsoap.sh
which produces:
Couldn't find a script at main, /home/radio/liquidsoap-daemon/script/main or /home/radio/liquidsoap-daemon/script/main.liq
Here is the list of folder /home/radio/liquidsoap-daemon:
-rw-r--r-- 1 root root 504 CHANGES
-rwxr-xr-x 1 root root 3619 daemonize-liquidsoap.sh
-rw-r--r-- 1 root root 1409 liquidsoap.initd.in
-rw-r--r-- 1 root root 541 liquidsoap.launchd.in
-rw-r--r-- 1 root root 326 liquidsoap.systemd.in
-rw-r--r-- 1 root root 1187 opam
-rw-r--r-- 1 root root 1922 README.md
What am I doing wrong?
Many thanks!
You are missing the script at /home/radio/liquidsoap-daemon/script/main
Create the folder script at /home/radio/liquidsoap-daemon/ and the file main.liq with e.g. output.dummy(blank()) in it.

custom yum repo not showing rpm

I have a yum repository I've set up where I store custom rpms.
I have no problem finding information about other packages that were built and stored in this custom repo.
#yum --disablerepo=rhui-us-east-rhel-server-1y,epel,epel-testing --enablerepo=customrepo install php53-pecl-xdebug
php53-pecl-xdebug x86_64 2.2.1-2 customrepo 132 k
No problem.
Now I drop somerpm.rpm in centos/repo/5/noarch, run createrepo --update . in this directory and try the same command, and yet it shows no results.
I tried running createrepo --update in the root of the repo as well, but that did not work either (I'm actually not sure where to run it and if it needs a repodata directory in each subdir).
[root#reposerver mnt]# ls -l /var/www/repo/
total 12
-rw-r--r-- 1 root root 203 Jun 8 00:13 REPO_README
drwxr-xr-x 3 root root 4096 Jun 10 2011 centos
drwxr-xr-x 2 root root 4096 Oct 18 20:02 repodata
[root#reposerver mnt]# ls -l /var/www/repo/centos/5/
SRPMS/ i386/ noarch/ repodata/ x86_64/
[root#reposerver mnt]# ls -l /var/www/repo/centos/5/noarch/
total 7324
-rw-r--r-- 1 root root 1622 Jun 28 2011 compat-php-5.1.6-1.noarch.rpm
drwxr-xr-x 2 root root 4096 Oct 18 19:55 repodata
-rw-r--r-- 1 root root 1066928 Oct 18 19:54 salt-0.10.3-1.noarch.rpm
-rw-r--r-- 1 root root 6363197 Oct 18 19:54 salt-0.10.3-1.src.rpm
-rw-r--r-- 1 root root 21822 Oct 18 19:54 salt-master-0.10.3-1.noarch.rpm
-rw-r--r-- 1 root root 14294 Oct 18 19:54 salt-minion-0.10.3-1.noarch.rpm
I also tried adding the exactarch=0 flag to my repo config to ignore arch restrictions and this did not work either, it was a shot in the dark, since my rpm is noarch, it should show regardless.
# cat /etc/yum.repos.d/mycompany.repo
[mycompany]
name=mycompany custom repo
baseurl=http://config/repo/centos/5/$basearch
enabled=1
exactarch=0
I'm at a loss at this point. Usually createrepo --update does the trick, but for some reason it cannot find the new rpms.
repo]# find . -type f -name "*.gz" | xargs zcat | grep salt-minion
returns results as well, so it's definitely in the repo data.
yum clean all on the server I was trying to install on worked.
Also make sure to do createrepo --update on the specific subdir instead of the root of the repo.

sphinx search data files

below is sphinx's data directory, is it safe to delete the .tmp files after indexing? will searchd use them?
-rw-r--r-- 1 root root 24M Apr 27 21:34 myindex.spa
-rw-r--r-- 1 root root 929M Apr 27 21:35 myindex.spd
-rw-r--r-- 1 root root 409 Apr 27 21:35 myindex.sph
-rw-r--r-- 1 root root 50M Apr 27 21:35 myindex.spi
-rw-r--r-- 1 root root 0 Apr 27 21:34 myindex.spk
-rw------- 1 root root 0 May 2 08:57 myindex.spl
-rw-r--r-- 1 root root 0 Apr 27 21:33 myindex.spm
-rw-r--r-- 1 root root 782M Apr 27 21:35 myindex.spp
-rw-r--r-- 1 root root 17M Apr 27 21:35 myindex.sps
-rw-r--r-- 1 root root 2.9G May 2 04:09 myindex.tmp.spa
-rw-r--r-- 1 root root 82G May 2 13:03 myindex.tmp.spd
-rw-r--r-- 1 root root 949M May 2 13:02 myindex.tmp.spi
-rw-r--r-- 1 root root 0 May 2 04:09 myindex.tmp.spk
-rw-r--r-- 1 root root 0 Apr 30 11:33 myindex.tmp.spl
-rw-r--r-- 1 root root 0 May 2 04:07 myindex.tmp.spm
-rw-r--r-- 1 root root 106G May 2 13:03 myindex.tmp.spp
-rw-r--r-- 1 root root 2.1G May 2 04:07 myindex.tmp.sps
-rw-r--r-- 1 root root 0 Apr 30 11:34 myindex.tmp.tmp0
-rw-r--r-- 1 root root 247G May 2 04:07 myindex.tmp.tmp1
-rw-r--r-- 1 root root 2.8G May 2 04:07 myindex.tmp.tmp2
-rw-r--r-- 1 root root 0 May 2 04:09 myindex.tmp.tmp8
I'm pretty sure that the .tmp files are created while you're indexing with the --rotate option defined. If you look at the timestamp on them you can see they're newer than the current indexes being used.
Once the rotate has completed the tmp files will replace the existing ones and the existing ones deleted.

Merging mongodb files in different location

May i know how do i merge my mongodb data files?
The following is my current situation:
At /data/db:
drwxr-xr-x 3 root root 4096 2011-03-15 06:38 .
drwxr-xr-x 3 root root 4096 2011-03-15 00:35 ..
-rwxr-xr-x 1 root root 5 2011-03-15 06:54 mongod.lock
drwxr-xr-x 2 root root 4096 2011-03-15 00:43 social_scraper
-rw------- 1 root root 67108864 2011-03-15 06:39 social_scraper.0
-rw------- 1 root root 134217728 2011-03-15 06:38 social_scraper.1
-rw------- 1 root root 16777216 2011-03-15 06:39 social_scraper.ns
At /var/lib/mongodb :
drwxr-xr-x 5 mongodb mongodb 4096 2011-03-15 07:06 .
drwxr-xr-x 46 root root 4096 2011-03-10 09:40 ..
-rwxr-xr-x 1 root root 0 2011-03-15 07:06 mongod.lock
drwxr-xr-x 2 root root 4096 2011-03-15 07:06 social_scraper
-rw------- 1 root root 67108864 2011-03-15 07:06 social_scraper.0
-rw------- 1 root root 134217728 2011-03-15 07:06 social_scraper.1
-rw------- 1 root root 16777216 2011-03-15 07:06 social_scraper.ns
How do i merge all of the records into /data/db or /var/lib/mongodb ?
The above records ( in both directories ) have been restored using mongod --repair
It will be great if specific steps can be given as I am quite a newbie when it comes to MongoDB maintainence.
I'm using ubuntu 10.04 server edition, MongoDB v1.6.5.
Best Regards.
You can use mongodump to move files from first database in bson files, and than use mongoimport to import dumped files into another database:
mongodump.exe --host localhost:27020 --db dbName
mongorestore.exe --host localhost:27020 --db secondDBName folderWithBsonFiles