総数:40 今日:1 昨日:0
Memorandums
CPE:customer-premises equipment
| name | description |
| OpenACS | Java + JBoss/Tomcat + EJB/MySQL で構成され、固有のビジネス・ロジックは JavaScript を使って定義出来るというユニークなアプリケーション。 仮想マシンのイメージも配布されておりすぐに試すことも可能なんですが、ここ数年は開発活動がほぼ停止しているところが気になります。 |
| GenieACS | GenieACS が面白いのは上位システム側 API (North Bound Interface)、CWMP インタフェース (South Bound Interface)、UI アプリケーションがそれぞれ分離・モジュール化されているところ。 NBI の RESTful な API だけを使ってユーザ・インタフェースは独自に実装する、ということも可能なんです。 ミドルウェアには Node.js, MongoDB, Redis, Ruby On Rails を採用(クールですけど少し気後れしますね・・・)。 |
http://netbuffalo.doorblog.jp/archives/4794185.html
https://genieacs.com/docs/
https://gist.github.com/si458/d3095c47339fad72ffaf5222dd7dbf49
sudo apt-get install -y build-essential git curl software-properties-common zlib1g-dev tmux libsqlite3-dev
~$ 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
https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-ubuntu/
~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
~$ 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
~$ sudo apt-get update
~$ 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) を設定しています ...
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:
| data files | /var/lib/mongodb |
| log files | /var/log/mongodb |
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.
~$ sudo service mongod start
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.
~$ sudo service mongod stop
~$ sudo service mongod restart
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
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/
~$ cd genieacs/ ~/genieacs$ npm install ~/genieacs$ npm audit fix
Before proceeding, find and review the file “config.json” in “config” directory where GenieACS is downloaded.
~/genieacs$ ls -la config/ 合計 24 drwxrwxr-x 2 tr069_server tr069_server 4096 3月 17 17:04 . drwxrwxr-x 8 tr069_server tr069_server 4096 3月 17 17:05 .. -rw-rw-r-- 1 tr069_server tr069_server 196 10月 24 04:48 auth-sample.js -rw-rw-r-- 1 tr069_server tr069_server 298 10月 24 04:48 config-sample.json -rw-r--r-- 1 tr069_server tr069_server 298 3月 17 17:04 config.json -rw-rw-r-- 1 tr069_server tr069_server 937 10月 24 04:48 ext-sample.js
~/genieacs$ cat config/config.json
{
"MONGODB_CONNECTION_URL" : "mongodb://127.0.0.1/genieacs",
"CWMP_INTERFACE" : "0.0.0.0",
"CWMP_PORT" : 7547,
"CWMP_SSL" : false,
"NBI_INTERFACE" : "0.0.0.0",
"NBI_PORT" : 7557,
"FS_INTERFACE" : "0.0.0.0",
"FS_PORT" : 7567,
"FS_HOSTNAME" : "acs.example.com",
"DEBUG" : false
}
Finally, run the following (from bin directory if installing from source):
~genieacs$ cd bin/ ~genieacs/bin$ ./genieacs-cwmp
This is the service that the CPEs will communicate with.
It listens to port 7547 by default (see config/config.json).
Configure the ACS URL of your devices accordingly (e.g. http://acs.example.com:7547/).
~genieacs/bin$ ./genieacs-nbi
This is the northbound interface module.
It exposes a REST API on port 7557 by default.
This must be running for the GUI front end to work.
~genieacs/bin$ ./genieacs-fs
This is the file server from which the CPEs will download firmware images and such.
Make sure to set the config option FS_HOSTNAME to your server’s hostname or IP.
Note: For production deployment it’s advised to run those as background services.
For further details about installation and configuration, refer to the wiki.
https://github.com/genieacs/genieacs/wiki
The front end component (genieacs-gui) is built with Ruby on Rails.
Install Ruby (2.2.2 or newer) and Bundler.
Clone the git repository:
git clone https://github.com/genieacs/genieacs-gui.git
Once that is done, create configuration files by copying the provided templates.
cd genieacs-gui cp config/graphs-sample.json.erb config/graphs.json.erb cp config/index_parameters-sample.yml config/index_parameters.yml cp config/summary_parameters-sample.yml config/summary_parameters.yml cp config/parameters_edit-sample.yml config/parameters_edit.yml cp config/parameter_renderers-sample.yml config/parameter_renderers.yml cp config/roles-sample.yml config/roles.yml cp config/users-sample.yml config/users.yml
Now install the required gems by typing (while in the project directory):
bundle
You’re now good to go. Start the application server:
rails s
Make sure the back end is running as the GUI depends on it.
See genieacs-gui’s wiki for more details.
https://github.com/genieacs/genieacs-gui/wiki