総数:40 今日:1 昨日:0
Memorandums

もくじ

specification

CPE:customer-premises equipment

TR-069 CPE WAN Management Protocol Amendment6

implementation

server

namedescription
OpenACSJava + JBoss/Tomcat + EJB/MySQL で構成され、固有のビジネス・ロジックは JavaScript を使って定義出来るというユニークなアプリケーション。
仮想マシンのイメージも配布されておりすぐに試すことも可能なんですが、ここ数年は開発活動がほぼ停止しているところが気になります。
GenieACSGenieACS が面白いのは上位システム側 API (North Bound Interface)、CWMP インタフェース (South Bound Interface)、UI アプリケーションがそれぞれ分離・モジュール化されているところ。
NBI の RESTful な API だけを使ってユーザ・インタフェースは独自に実装する、ということも可能なんです。
ミドルウェアには Node.js, MongoDB, Redis, Ruby On Rails を採用(クールですけど少し気後れしますね・・・)。

TR-069 - GenieACS で始める Auto Configuration Server

http://netbuffalo.doorblog.jp/archives/4794185.html

Install GenieACS on Ubuntu 18.04.2

https://genieacs.com/docs/
https://gist.github.com/si458/d3095c47339fad72ffaf5222dd7dbf49

install essential packages

sudo apt-get install -y build-essential git curl software-properties-common zlib1g-dev tmux libsqlite3-dev

install nodejs

~$ wget https://deb.nodesource.com/setup_8.x
~$ mv setup_8.x install_Nodejs8.x_LTS_Carbon_repo.sh
~$ chmod a+x install_Nodejs8.x_LTS_Carbon_repo.sh
~$ sudo bash
~# ./install_Nodejs8.x_LTS_Carbon_repo.sh 
## Installing the NodeSource Node.js 8.x LTS Carbon repo...


## Populating apt-get cache...

+ apt-get update
ヒット:1 http://jp.archive.ubuntu.com/ubuntu bionic InRelease
取得:2 http://jp.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                      
取得:3 http://jp.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                    
ヒット:4 http://security.ubuntu.com/ubuntu bionic-security InRelease                               
163 kB を 1秒 で取得しました (200 kB/s)                          
パッケージリストを読み込んでいます... 完了

## Confirming "bionic" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_8.x/dists/bionic/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
OK

## Creating apt sources list file for the NodeSource Node.js 8.x LTS Carbon repo...

+ echo 'deb https://deb.nodesource.com/node_8.x bionic main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_8.x bionic main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
ヒット:1 http://jp.archive.ubuntu.com/ubuntu bionic InRelease
取得:2 http://jp.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                      
取得:3 https://deb.nodesource.com/node_8.x bionic InRelease [4,595 B]                              
取得:4 http://jp.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                    
ヒット:5 http://security.ubuntu.com/ubuntu bionic-security InRelease                               
取得:6 https://deb.nodesource.com/node_8.x bionic/main i386 Packages [765 B]
取得:7 https://deb.nodesource.com/node_8.x bionic/main amd64 Packages [766 B]     
169 kB を 1秒 で取得しました (217 kB/s)
パッケージリストを読み込んでいます... 完了

## Run `sudo apt-get install -y nodejs` to install Node.js 8.x LTS Carbon and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn

~# exit
~$ sudo apt-get install -y nodejs

You may also need development tools to build native addons:

~$ sudo apt-get install gcc g++ make

To install the Yarn package manager, run:

~$ sudo bash
~# curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
~# echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
~# exit
~$ sudo apt-get update
~$ sudo apt-get install yarn

install mongodb

https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-ubuntu/

Import the public key used by the package management system

~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4

Create a /etc/apt/sources.list.d/mongodb-enterprise.list file for MongoDB.

~$ sudo bash
~# echo "deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/4.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-enterprise.list
~# exit

Reload local package database

~$ sudo apt-get update

Install the MongoDB Enterprise packages

~$ sudo apt-get install -y mongodb-enterprise
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
  mongodb-enterprise-mongos mongodb-enterprise-server mongodb-enterprise-shell
  mongodb-enterprise-tools snmp
以下のパッケージが新たにインストールされます:
  mongodb-enterprise mongodb-enterprise-mongos mongodb-enterprise-server mongodb-enterprise-shell
  mongodb-enterprise-tools snmp
アップグレード: 0 個、新規インストール: 6 個、削除: 0 個、保留: 67 個。
68.3 MB のアーカイブを取得する必要があります。
この操作後に追加で 288 MB のディスク容量が消費されます。
取得:1 http://jp.archive.ubuntu.com/ubuntu bionic-updates/main amd64 snmp amd64 5.7.3+dfsg-1.8ubuntu3.1 [158 kB]
取得:2 http://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/4.0/multiverse amd64 mongodb-enterprise-shell amd64 4.0.6 [9,840 kB]
取得:3 http://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/4.0/multiverse amd64 mongodb-enterprise-server amd64 4.0.6 [16.0 MB]
取得:4 http://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/4.0/multiverse amd64 mongodb-enterprise-mongos amd64 4.0.6 [8,904 kB]
取得:5 http://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/4.0/multiverse amd64 mongodb-enterprise-tools amd64 4.0.6 [33.4 MB]
取得:6 http://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/4.0/multiverse amd64 mongodb-enterprise amd64 4.0.6 [3,540 B]
68.3 MB を 9秒 で取得しました (7,315 kB/s)                                                         
以前に未選択のパッケージ mongodb-enterprise-shell を選択しています。
(データベースを読み込んでいます ... 現在 174673 個のファイルとディレクトリがインストールされています。)
.../0-mongodb-enterprise-shell_4.0.6_amd64.deb を展開する準備をしています ...
mongodb-enterprise-shell (4.0.6) を展開しています...
以前に未選択のパッケージ snmp を選択しています。
.../1-snmp_5.7.3+dfsg-1.8ubuntu3.1_amd64.deb を展開する準備をしています ...
snmp (5.7.3+dfsg-1.8ubuntu3.1) を展開しています...
以前に未選択のパッケージ mongodb-enterprise-server を選択しています。
.../2-mongodb-enterprise-server_4.0.6_amd64.deb を展開する準備をしています ...
mongodb-enterprise-server (4.0.6) を展開しています...
以前に未選択のパッケージ mongodb-enterprise-mongos を選択しています。
.../3-mongodb-enterprise-mongos_4.0.6_amd64.deb を展開する準備をしています ...
mongodb-enterprise-mongos (4.0.6) を展開しています...
以前に未選択のパッケージ mongodb-enterprise-tools を選択しています。
.../4-mongodb-enterprise-tools_4.0.6_amd64.deb を展開する準備をしています ...
mongodb-enterprise-tools (4.0.6) を展開しています...
以前に未選択のパッケージ mongodb-enterprise を選択しています。
.../5-mongodb-enterprise_4.0.6_amd64.deb を展開する準備をしています ...
mongodb-enterprise (4.0.6) を展開しています...
snmp (5.7.3+dfsg-1.8ubuntu3.1) を設定しています ...
mongodb-enterprise-server (4.0.6) を設定しています ...
システムユーザー `mongodb' (UID 122) を追加しています...
新しいユーザー `mongodb' (UID 122) をグループ `nogroup' に追加しています...
ホームディレクトリ `/home/mongodb' を作成しません。
グループ `mongodb' (GID 127) を追加しています...
完了。
ユーザー `mongodb' をグループ `mongodb' に追加しています...
ユーザ mongodb をグループ mongodb に追加
完了。
mongodb-enterprise-shell (4.0.6) を設定しています ...
mongodb-enterprise-tools (4.0.6) を設定しています ...
man-db (2.8.3-2ubuntu0.1) のトリガを処理しています ...
mongodb-enterprise-mongos (4.0.6) を設定しています ...
mongodb-enterprise (4.0.6) を設定しています ...

Pin a specific version of MongoDB Enterprise

Although you can specify any available version of MongoDB, apt-get upgrades the packages when a newer version becomes available. To prevent unintended upgrades, pin the package. To pin the version of MongoDB at the currently installed version, issue the following command sequence:

~$ sudo bash
~# echo "mongodb-enterprise hold" | dpkg --set-selections
~# echo "mongodb-enterprise-server hold" | dpkg --set-selections
~# echo "mongodb-enterprise-shell hold" | dpkg --set-selections
~# echo "mongodb-enterprise-mongos hold" | dpkg --set-selections
~# echo "mongodb-enterprise-tools hold" | dpkg --set-selections
~# exit

設定ファイルの中身

どこにinstallされたかみてみる

~$ which mongod
/usr/bin/mongod

設定ファイルの中身

~$ cat /etc/mongod.conf 
# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

参考 MongoDB

By default, MongoDB instance stores:

data files/var/lib/mongodb
log files/var/log/mongodb

By default, MongoDB runs using the mongodb user account

If you change the user that runs the MongoDB process,
you must also modify the permission to the /var/lib/mongodb and /var/log/mongodb directories
to give this user access to these directories.

Start MongoDB

~$ sudo service mongod start

Verify that MongoDB has started successfully

Verify that the mongod process has started successfully
by checking the contents of the log file at /var/log/mongodb/mongod.log
for a line reading

[initandlisten] waiting for connections on port 27017

27017 is the default port the standalone mongod listens on.

Stop MongoDB

~$ sudo service mongod stop

Restart MongoDB

~$ sudo service mongod restart

Begin using MongoDB

Start a mongo shell on the same host machine as the mongod.
You can run the mongo shell without any command-line options
to connect to a mongod
that is running on your localhost with default port 27017:

~$ mongo

get GenieACS source code

v1.1.3

https://github.com/genieacs/genieacs/archive/v1.1.3.tar.gz

genieacs-1.1.3.tar.gz を homeにstoreしたとする。

~$ tar xzpf genieacs-1.1.3.tar.gz
~$ mv genieacs-1.1.3/ genieacs/

install GenieACS

~$  cd genieacs/

インストールしたはずのrubyやgemが見つからなかったり古かったりした場合の確認事項

https://qiita.com/KakeiAkihiko/items/50e7af8ca9fd711443d3


トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS