InstallingSiteWhere
SiteWhereprovides many options for installation depending on userrequirements. There are options for running SiteWhere locally or invarious cloud environments.
安装SiteWhere
SiteWhere根据客户需求提供了多种安装选择,可以在本地主机上安装,也可以在多种云环境中安装。
InstallingLocally on Linux
InstallingSiteWhere locally with the default configuration requires threecomponents: a SiteWhere server distribution, a MongoDB instance, andan MQTT broker. The following steps can be executed on a new Ubuntu14.04 (or similar) instance. Similar commands should work on otherLinux/Unix variants.
在本地linux环境中安装
sitewhere本地安装在缺省配置情况下需要三个组件,sitewhere服务器版本,MongoDB和MQTT代理。下面是在ubuntu14.04上的安装步骤,其他linux/unix版本应该类似。
UpdateComponents and Install Required Tools
Startby making sure the Ubuntu instance is running the latest versions ofits included software. Also, the following steps will install theunzip command and a JDK.
更新组件和安装工具
确保ubuntu及相关的软件是新的,下面是unzip和JDK安装步骤。
sudo su
add-apt-repository ppa:openjdk-r/ppa
apt-get update -y
apt-get install unzip openjdk-8-jdk
InstallMongoDB for Persistence
Thedefault SiteWhere configuration uses MongoDB for persistence ofdevice management and event data. Other persistence stores such asApache HBase and InfluxDB may also be used. The commands below willinstall MongoDB with the default settings.
安装MongoDB作为持久数据存储
sitewhere缺省配置是使用mongodb作为设备管理和事件数据的持久存储。也可以使用ApacheHbase和influxDB作为数据持久存储。下面安装mongodb。
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB1
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
apt-get update
apt-get install -y mongodb-org
echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
service mongod start
Installthe HiveMQ MQTT Broker
Thedefault SiteWhere configuration uses MQTT for receiving device eventdata and sending device commands. HiveMQ provides a free edition witha limited number of connections that works well for most situations.
安装HiveMQMQTT代理
sitewhere默认使用MQTT作为接受设备事件数据和发送设备指令。HiveMQ是免费版本,在连接性方面有限制,但大部分情况都能满足要求。
cd /opt
wget --content-disposition https://s3.amazonaws.com/sitewhere-hivemq/hivemq-3.0.2.zip
unzip hivemq-3.0.2.zip
wget --content-disposition https://s3.amazonaws.com/sitewhere-hivemq/config.xml
mv config.xml hivemq-3.0.2/conf
cd hivemq-3.0.2/bin
./run.sh &
HiveMQ is run asa background task. Pressenter a to return to acommand prompt.
hiveMQ在后台运行,按enter进入命令行操作。
Installa SiteWhere Server Release
Thesesteps will download a SiteWhere distribution from the communitywebsite and install it locally.
安装sitewhere服务器版本
下载sitewhere安装。
cd /opt
wget https://s3.amazonaws.com/sitewhere/sitewhere-server-1.6.0.tgz
tar -zxvf sitewhere-server-1.6.0.tgz
mv sitewhere-server-1.6.0 /opt/sitewhere
export CATALINA_HOME=/opt/sitewhere
cd /opt/sitewhere/bin
chmod +x *.sh
sh startup.sh
总结:按照以上安装过程很流畅,存在的一个问题是
-