Jun's Blog

Output, activities, memo and etc.

Install MongoDB 3.4.3 on Fedora 26

Use the RPM packages.

In case of Fedora MongoDB RPM Package, mongodb RPM includes the client commands "mongo". mongodb-server RPM includes the server files and the commands such as "mongod" and "mongos".

Install

Install is easy. Just type dnf install.

Build single non-sharding and single server, as it is used as a local development.

$ sudo dnf install mongo mongodb-server
$ rpm -q mongodb mongodb-server
mongodb-3.4.3-1.fc26.x86_64
mongodb-server-3.4.3-1.fc26.x86_64
$ rpm -ql mongodb
/usr/bin/mongo
/usr/bin/mongobridge
/usr/bin/mongoperf
/usr/share/doc/mongodb
/usr/share/doc/mongodb/README
/usr/share/licenses/mongodb
/usr/share/licenses/mongodb/APACHE-2.0.txt
/usr/share/licenses/mongodb/GNU-AGPL-3.0.txt
/usr/share/man/man1/mongo.1.gz
/usr/share/man/man1/mongoperf.1.gz
$ rpm -ql mongodb-server
/etc/logrotate.d/mongodb
/etc/mongod.conf
/etc/mongos.conf
/etc/sysconfig/mongod
/etc/sysconfig/mongos
/usr/bin/mongod
/usr/bin/mongos
/usr/lib/systemd/system/mongod.service
/usr/lib/systemd/system/mongos.service
/usr/lib/tmpfiles.d/mongodb.conf
/usr/share/man/man1/mongod.1.gz
/usr/share/man/man1/mongos.1.gz
/var/lib/mongodb
/var/log/mongodb
/var/run/mongodb
$ cat /etc/passwd | grep mongodb
mongodb:x:184:184:MongoDB Database Server:/var/lib/mongodb:/sbin/nologin

Configuration

Change the database directory's partition.

As /var/lib/mongodb used as storage directory is in small sized partition, I changed it to bigger /home partition.

$ mkdir -p /home/jaruga/var/lib/mongodb

$ sudo chown mongodb:root /home/jaruga/var/lib/mongodb

$ ls -dl /home/jaruga/var/lib/mongodb
drwxrwxr-x 2 mongodb root 4096 Nov 12 22:18 /home/jaruga/var/lib/mongodb

$ chmod 755 /home/jaruga
$ cd /var/lib

$ sudo rm -rf mongodb

$ sudo ln -s /home/jaruga/var/lib/mongodb mongodb

$ ls -l /var/lib/mongodb
lrwxrwxrwx 1 root root 28 Nov 12 22:26 /var/lib/mongodb -> /home/jaruga/var/lib/mongodb/

Run

$ sudo systemctl start mongod

$ systemctl status mongod | grep Active
   Active: active (running) since Sun 2017-11-12 23:32:19 CET; 14min ago

$ mongo
MongoDB shell version v3.4.3
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.3
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
  http://docs.mongodb.org/
Questions? Try the support group
  http://groups.google.com/group/mongodb-user
Server has startup warnings: 
2017-11-12T22:36:29.770+0100 I STORAGE  [initandlisten] 
2017-11-12T22:36:29.770+0100 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-11-12T22:36:29.770+0100 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-11-12T22:36:30.232+0100 I CONTROL  [initandlisten] 
2017-11-12T22:36:30.232+0100 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-11-12T22:36:30.232+0100 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-11-12T22:36:30.232+0100 I CONTROL  [initandlisten] 
2017-11-12T22:36:30.232+0100 I CONTROL  [initandlisten] 
2017-11-12T22:36:30.232+0100 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 30566 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
>
> db
test

> use test
switched to db test

> exit
bye

$ sudo systemctl stop mongod

It works.

Reference: Install MongoDB Community Edition on Red Hat Enterprise or CentOS Linux — MongoDB Manual 3.4

Visualization is a key for learning

I realized it recently.

I am saving my memory's main structure as an image. It is something like the

  1. Tree trunk: saving as an image or sense.
  2. Small branches and leaves: saving as an text.

To get information from my brain. Maybe I am accessing to 1. at first. Then if needed, accessing to 2. That's a reason to save much information in my brain.

Designing new product, imaging the structure has been the key.

In fact, I am planning year resolution every year. The trunk is saved as image files in my PC. I can image my plan in this year seeing it. And that has been effective way for me.

When I realized this fact, I started to use this way to AI/Machine Learning area, and Genomics area.

About AI/Machine Learning area,

Searching this kind of book with the key words "Graphic or Visual or Machine Learning", and etc, I found below 2 books about Machine Learning and Deep Learning. (Japanese language).

TickTack World

Very sensible books. Amazing. Outstanding book. Author is sensible for not only AI/Machine Learning, also sensible for copy writing and other areas. Maybe he is good at understanding a key feature amount from a phenomenon and information.

As a result, from those books, still reading, but I could understand the concept roughly. Well, I have the experience for the area, but I could not understand it well.

As my next action, I want to dig Deep Learning and Neural Network for Natural Language Processing.

About Genomics area, I bought several books in Amazon and did read those. My favorite books are "Newton" that is Japanese Graphic Science Book. There are the Kindle versions. Those help me.

Great videos and the Youtube channel. That visual is fun. And the explanation is sensible.

www.youtube.com