Mac下部署與啟動STF


一、stf在Mac下的部署
1、安裝Java及jdk
可自己谷歌(如果不能自建雲梯)
2、安裝nodejs包(我是直接在官網下載的LTS版本)
• Node.js v8.12.0 to /usr/local/bin/node
• npm v6.4.1 to /usr/local/bin/npm

3、安裝bower
npm install bower -g
驗證安裝是否成功:bower -v 如果顯示版本號證明安裝成功

4、安裝RethinkDB包
brew install rethinkdb
驗證安裝是否成功:rethinkdb -v 如果顯示版本號證明安裝成功

5、安裝GraphicsMagick
brew install graphicsmagick
如果出現如下提示證明已經安裝過:
Warning: graphicsmagick 1.3.30 is already installed and up-to-date
To reinstall 1.3.30, run `brew reinstall graphicsmagick`

6. 安裝libsodium(zeromq的依賴)
brew install libsodium

==> Downloading https://homebrew.bintray.com/bottles/libsodium-1.0.16.mojave.bot
######################################################################## 100.0%
==> Pouring libsodium-1.0.16.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/libsodium/1.0.16: 71 files, 940.7KB

7. 安裝zeromq
brew install zeromq

==> Downloading https://homebrew.bintray.com/bottles/zeromq-4.2.5.mojave.bottle.
######################################################################## 100.0%
==> Pouring zeromq-4.2.5.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/zeromq/4.2.5: 77 files, 2.7MB

8. 安裝protobuf(初次安裝的時候會有依賴:gdbm, openssl, readline, sqlite會一並安裝)
brew install protobuf

==> Installing dependencies for protobuf: gdbm, openssl, readline and sqlite
==> Installing protobuf dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.18.mojave.bottle.tar
######################################################################## 100.0%
==> Pouring gdbm-1.18.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/gdbm/1.18: 20 files, 588.7KB
==> Installing protobuf dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2p.mojave.bottl
######################################################################## 100.0%
==> Pouring openssl-1.0.2p.mojave.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs

and run
/usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> Summary
🍺 /usr/local/Cellar/openssl/1.0.2p: 1,793 files, 12MB
==> Installing protobuf dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-7.0.5.mojave.bottl
######################################################################## 100.0%
==> Pouring readline-7.0.5.mojave.bottle.tar.gz
==> Caveats
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.

For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"

==> Summary
🍺 /usr/local/Cellar/readline/7.0.5: 46 files, 1.5MB
==> Installing protobuf dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.25.2.mojave.bottle
######################################################################## 100.0%
==> Pouring sqlite-3.25.2.mojave.bottle.tar.gz
==> Caveats
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.

If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile

For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"

For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"

==> Summary
🍺 /usr/local/Cellar/sqlite/3.25.2: 11 files, 3.7MB
==> Installing protobuf
==> Downloading https://homebrew.bintray.com/bottles/protobuf-3.6.1.mojave.bottl
######################################################################## 100.0%
==> Pouring protobuf-3.6.1.mojave.bottle.tar.gz
==> Caveats
Editor support and examples have been installed to:
/usr/local/opt/protobuf/share/doc/protobuf
==> Summary
🍺 /usr/local/Cellar/protobuf/3.6.1: 256 files, 17.2MB
==> Caveats
==> openssl
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs

and run
/usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> readline
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.

For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"

==> sqlite
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.

If you need to have sqlite first in your PATH run:
echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile

For compilers to find sqlite you may need to set:
export LDFLAGS="-L/usr/local/opt/sqlite/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include"

For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"

==> protobuf
Editor support and examples have been installed to:
/usr/local/opt/protobuf/share/doc/protobuf

修改環境變量,添加如下信息(我這里安裝的版本是3.6.1):
export PATH=$PATH:/usr/local/Cellar/protobuf/3.6.1/bin/
export PKG_CONFIG_PATH=/usr/local/Cellar/protobuf/3.6.1/lib/pkgconfig/

9. 安裝pkg-config
brew install pkg-config
出現如下的提示證明已經安裝過:
Warning: pkg-config 0.29.2 is already installed and up-to-date
To reinstall 0.29.2, run `brew reinstall pkg-config`


10、安裝yasm
brew install yasm

==> Downloading https://homebrew.bintray.com/bottles/yasm-1.3.0_1.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring yasm-1.3.0_1.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/yasm/1.3.0_1: 47 files, 3.8MB

11. 安裝stf
(如果出現報錯先清下緩存:npm cache clean --force)
npm install -g stf

部署完成功之后,可以使用stf doctor命令查看是否都已經部署妥當。如下表示都已經部署好:

 

二、stf在Mac下的啟動

1、終端一啟動rethinkdb數據庫

 

2、終端二啟動stf,以下為兩種啟動方式選其一

本地啟動:stf local
允許遠程訪問:stf local --public-ip 本機IP --allow-remote

 

3、瀏覽器輸入地址即可訪問:127.0.0.1:7100

現在就可以在頁面上直接控制連接的設備了,按照官方的說法,可以控制more than 160 devices. 當然 要有好的hub或者無線環境。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM