分类 Linux 下的文章

Linux下软件环境安装(10)-dnsmasq安装与配置

sudo apt-get -y install dnsmasq

sudo vi /etc/dnsmasq.conf
address=/double-click.net/127.0.0.1
server=192.168.1.1

ping double-click.net
PING double-click.net (91.195.240.126) 56(84) bytes of data

cat /etc/resolv.conf
sudo /etc/init.d/dnsmasq restart

参考文献:
https://www.cnblogs.com/ilanni/p/4927332.html

Linux下软件环境安装(9)-influxDB安装与配置

https://portal.influxdata.com/downloads/

Telegraf - Time-Series Data Collector
InfluxDB - Time-Series Data Storage
Chronograf - Time-Series Data Visualization
Kapacitor - Time-Series Data Processing

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.7.8_amd64.deb
sudo dpkg -i influxdb_1.7.8_amd64.deb

Created symlink from /etc/systemd/system/influxd.service to /lib/systemd/system/influxdb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/influxdb.service to /lib/systemd/system/influxdb.service.

sudo vi /etc/influxdb/influxdb.conf
改/home/.../influxdb
influxd config
influxd run &

influx -host 127.0.0.1
show databases
create database "gui"
use gui
show measurements
insert test,host=127.0.0.1,monitor_name=test count=2
select * from test limit 10
exit
相关操作命令:https://blog.csdn.net/x541211190/article/details/82948201

https://grafana.com/docs/installation/debian/
https://grafana.com/grafana/download?platform=linux
wget https://dl.grafana.com/oss/release/grafana_6.4.1_amd64.deb
sudo dpkg -i grafana_6.4.1_amd64.deb

NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server

You can start grafana-server by executing

sudo /bin/systemctl start grafana-server

Linux下软件环境安装(9)-Redis安装与配置

wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable

sudo apt-get install make gcc

make
src/redis-server --protected-mode no &
src/redis-cli
#./redis-cli -h x.17.0.10 -p 6379

sudo bash -c 'echo never > /sys/kernel/mm/transparent_hugepage/enabled'

echo "vm.overcommit_memory=1" > /etc/sysctl.conf
echo 2048 > /proc/sys/net/core/somaxconn

在/etc/sysctl.conf中添加如下
vm.overcommit_memory = 1
net.core.somaxconn = 2048
然后在终端中执行
sudo sysctl -p

sudo vi /etc/rc.local
#!/bin/sh -e

rc.local

This script is executed at the end of each multiuser runlevel.

Make sure that the script will "exit 0" on success or any other

value on error.

In order to enable or disable this script just change the execution

bits.

By default this script does nothing.

echo never > /sys/kernel/mm/transparent_hugepage/enabled

exit 0

sudo chown root:root /etc/rc.local
sudo chmod 755 /etc/rc.local
sudo systemctl enable rc-local.service

linux文件系统目录结构rootfs

/(1区)
根文件夹
/bin
可执行二进制文件的目录
/boot(0区)
放置Linux系统启动时用到的一些文件,建议单独分区,分区大小100M即可
/dev(udev)
存放Linux系统下的设备文件
/etc
系统配置文件存放的目录,不建议在此目录下存放可执行文件
/home
系统默认的用户家目录
/lib
系统使用的函数库的目录
/lost+found
系统异常产生错误时,会将一些遗失的片段放置于此目录下
/media
/mnt
默认挂载点
/opt
给主机额外安装软件所摆放的目录
/proc
此目录的数据都在内存中,如系统核心,外部设备,网络状态
/ramdisk(tmpfs)
自建虚拟路径
/root
系统管理员root的目录
/run(tmpfs)
*运行时需要的东西
/sbin
放置系统管理员使用的可执行命令
/srv
服务启动之后需要访问的数据目录
/sys
*全局设备结构体系
/tmp
一般用户或正在执行的程序临时存放文件的目录
/usr
应用程序存放目录
/usr/bin
可执行二进制文件的目录
/usr/lib
/usr/local/lib
系统使用的函数库的目录
/usr/sbin
/usr/local/sbin
放置系统管理员使用的可执行命令
/var
放置系统执行过程中经常变化的文件

参考文献:
https://www.linuxidc.com/Linux/2013-09/89743.htm

Linux下软件环境安装(8)-MQTT Mosquitto安装与配置

装在docker里ubuntu 18.04.2
docker run -ti -h mqtt -p 8882:22 -p 8883:1883 --name mqtt withsshd
apt-get install software-properties-common
apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
apt-get update
apt-get install mosquitto mosquitto-clients
service mosquitto status
service mosquitto start
这样就OK了!