You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/docs/研发/环境配置.md

3.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

windows 10下需要安装的软件

visual studio 2019 社区版(https://visualstudio.microsoft.com/vs/

windows 10 linux 子系统

安装系统并配置root登录

1.按照Unbuntu 18.04 LTS 1.设置用户名和密码为pi输入sudo passwd root设置root密码为root 1.命令行配置root启动ubuntu1804 config --default-user root 1.命令行wsl -t Ubuntu-18.04 关闭linux子系统 1.以管理员方式运行linux子系统

更新

1.检查CPU架构版本uanme -a 1.更换源:

lsb_release -a cp /etc/apt/sources.list /etc/apt/sources.list.bk

/etc/apt/sources.list nano /etc/apt/sources.list 根据lsb_release命令获取的Codename替换下面地址中的Codename deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse 复制上面更新过的内容并替换/etc/apt/sources.list apt update

安装软件

安装supervisorhttp://supervisord.org/

apt install supervisor mv /etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf.bk

/etc/supervisor/supervisord.conf 复制publish\src\linux-x64\publish\supervisord.conf内容替换/etc/supervisor/supervisord.conf service supervisor start

安装nginx http://nginx.org/en/linux_packages.html#Ubuntu

apt install curl gnupg2 ca-certificates lsb-release echo "deb http://nginx.org/packages/ubuntu lsb_release -cs nginx"
| sudo tee /etc/apt/sources.list.d/nginx.list curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add - apt-key fingerprint ABF5BD827BD9BF62 apt update apt install nginx 复制\publish\src\linux-x64\publish\nginx.conf内容替换/etc/nginx/nginx.conf service nginx start

安装influxdbhttps://portal.influxdata.com/downloads/

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.7.8_amd64.deb sudo dpkg -i influxdb_1.7.8_amd64.deb service influxd start apt install influxdb-client

nano /etc/ssh/sshd_config PermitRootLogin yes ssh-keygen -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key service ssh restart

==========================================================

安装pip

apt install python-pip pip --version

##安装supervisorhttp://supervisord.org/

pip install supervisor mv /etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf.bk

/etc/supervisor/supervisord.conf 复制publish\src\linux-x64\publish\supervisord.conf内容替换/etc/supervisor/supervisord.conf 设置开机启动sudo systemctl enable supervisor

##安装mysql

##windows的linux子系统无法设置开机启动手动创建start.sh脚本并在开机后执行

service ssh start service supervisor start service nginx start influxd >/dev/null 2>&1 & dockerd --iptables=false

可以通过crontab reboot的方式开机运行(未验证)

##docker https://docs.docker.com/install/linux/docker-ce/ubuntu/ 以管理员权限启动linux子系统(https://www.jianshu.com/p/20ebdbf68744)