本篇笔记介绍开发所需的几个基础依赖工具。
小能手最近在学习 LoRa Server 项目,应该是最有影响力的 LoRaWAN 服务器开源项目。它组件丰富,代码可读性强,是个很好的学习资料。更多学习笔记,可点此查看。
sudo yum install mosquitto mosquitto-clients
PostgreSQL 的安装具体见官网:https://www.postgresql.org/download/linux/redhat/
# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
To use the PostgreSQL Yum Repository, follow these steps:
yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
> yum install postgresql11
yum install postgresql11-server
/usr/pgsql-11/bin/postgresql-11-setup initdb
systemctl enable postgresql-11
systemctl start postgresql-11
配置操作如下:
# sudo -u postgres psql
psql (11.2)
Type "help" for help.
postgres=# create role loraserver_as with login password 'dbpassword';
CREATE ROLE
postgres=# create role loraserver_ns with login password 'dbpassword';
CREATE ROLE
postgres=# create database loraserver_as with owner loraserver_as;
CREATE DATABASE
postgres=# create database loraserver_ns with owner loraserver_ns;
CREATE DATABASE
postgres=# \c loraserver_as
You are now connected to database "loraserver_as" as user "postgres".
loraserver_as=# create extension pg_trgm;
ERROR: could not open extension control file "/usr/pgsql-11/share/extension/pg_trgm.control": No such file or directory
loraserver_as=# \q
这种问题下,需要安装下插件。
# sudo yum install postgresql11-contrib
再试下就可以了。
# sudo -u postgres psql
psql (11.2)
Type "help" for help.
postgres=# \c loraserver_as
You are now connected to database "loraserver_as" as user "postgres".
loraserver_as=# create extension pg_trgm;
CREATE EXTENSION
loraserver_as=# \q
Redis 是个比较流行的内存数据存储的数据库,在这个项目中也有用到。
具体安装方法 点击这里。
redis-server --appendonly yes