influxdb-1.7.8(centos 7) 部署
1、官方下载:
https://dl.influxdata.com/influxdb/releases/influxdb-1.7.8.x86_64.rpm
2、安装软件
sudo yum localinstall influxdb-1.7.8.x86_64.rpm
3、环境准备
mkdir -p /data/influxdb/data
chmod -R 777 /data
4、包文件路径
/usr/bin下
- influxd influxdb服务器
- influx influxdb命令行客户端
- influx_inspect 查看工具
- influx_stress 压力测试工具
- influx_tsm 数据库转换工具(将数据库从b1或bz1格式转换为tsm1格式)
/var/lib/influxdb/下
- data 存放最终存储的数据,文件以.tsm结尾
- meta 存放数据库元数据
- wal 存放预写日志文件
/var/log/influxdb下
- influxd.log 日志文件
/etc/influxdb下
- influxdb.conf 配置文件
/var/run/influxdb/
- influxd.pid PID文件
5、备份配置文件
mv /etc/influxdb/influxdb.conf /etc/influxdb/influxdb.conf.default
6、更新配置文件
vim /etc/influxdb/influxdb.conf
### Welcome to the InfluxDB configuration file. # The values in this file override the default values used by the system if
# a config option is not specified. The commented out lines are the configuration
# field and the default value used. Uncommenting a line and changing the value
# will change the value used at runtime when the process is restarted. # Once every 24 hours InfluxDB will report usage data to usage.influxdata.com
# The data includes a random ID, os, arch, version, the number of series and other
# usage data. No data from user databases is ever transmitted.
# Change this option to true to disable reporting.
# reporting-disabled = false # Bind address to use for the RPC service for backup and restore.
# bind-address = "127.0.0.1:8088" ###
### [meta]
###
### Controls the parameters for the Raft consensus group that stores metadata
### about the InfluxDB cluster.
### [meta]
# Where the metadata/raft database is stored
dir = "/data/influxdb/data/meta" # Automatically create a default retention policy when creating a database.
retention-autocreate = true # If log messages are printed for the meta service
# logging-enabled = true ###
### [data]
###
### Controls where the actual shard data for InfluxDB lives and how it is
### flushed from the WAL. "dir" may need to be changed to a suitable place
### for your system, but the WAL settings are an advanced configuration. The
### defaults should work for most systems.
### [data]
# The directory where the TSM storage engine stores TSM files.
dir = "/data/influxdb/data/data" # The directory where the TSM storage engine stores WAL files.
wal-dir = "/data/influxdb/data/wal" # The amount of time that a write will wait before fsyncing. A duration
# greater than 0 can be used to batch up multiple fsync calls. This is useful for slower
# disks or when WAL write contention is seen. A value of 0s fsyncs every write to the WAL.
# Values in the range of 0-100ms are recommended for non-SSD disks.
wal-fsync-delay = "0s" # The type of shard index to use for new shards. The default is an in-memory index that is
# recreated at startup. A value of "tsi1" will use a disk based index that supports higher
# cardinality datasets.
# index-version = "inmem"
index-version = "tsi1" # Trace logging provides more verbose output around the tsm engine. Turning
# this on can provide more useful output for debugging tsm engine issues.
# trace-logging-enabled = false # Whether queries should be logged before execution. Very useful for troubleshooting, but will
# log any sensitive data contained within a query.
# query-log-enabled = true # Validates incoming writes to ensure keys only have valid unicode characters.
# This setting will incur a small overhead because every key must be checked.
# validate-keys = false # Settings for the TSM engine # CacheMaxMemorySize is the maximum size a shard's cache can
# reach before it starts rejecting writes.
# Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k).
# Values without a size suffix are in bytes.
# cache-max-memory-size = "1g" # CacheSnapshotMemorySize is the size at which the engine will
# snapshot the cache and write it to a TSM file, freeing up memory
# Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k).
# Values without a size suffix are in bytes.
# cache-snapshot-memory-size = "25m" # CacheSnapshotWriteColdDuration is the length of time at
# which the engine will snapshot the cache and write it to
# a new TSM file if the shard hasn't received writes or deletes
# cache-snapshot-write-cold-duration = "10m" # CompactFullWriteColdDuration is the duration at which the engine
# will compact all TSM files in a shard if it hasn't received a
# write or delete
# compact-full-write-cold-duration = "4h" # The maximum number of concurrent full and level compactions that can run at one time. A
# value of 0 results in 50% of runtime.GOMAXPROCS(0) used at runtime. Any number greater
# than 0 limits compactions to that value. This setting does not apply
# to cache snapshotting.
# max-concurrent-compactions = 0 # CompactThroughput is the rate limit in bytes per second that we
# will allow TSM compactions to write to disk. Note that short bursts are allowed
# to happen at a possibly larger value, set by CompactThroughputBurst
# compact-throughput = "48m" # CompactThroughputBurst is the rate limit in bytes per second that we
# will allow TSM compactions to write to disk.
# compact-throughput-burst = "48m" # If true, then the mmap advise value MADV_WILLNEED will be provided to the kernel with respect to
# TSM files. This setting has been found to be problematic on some kernels, and defaults to off.
# It might help users who have slow disks in some cases.
# tsm-use-madv-willneed = false # Settings for the inmem index # The maximum series allowed per database before writes are dropped. This limit can prevent
# high cardinality issues at the database level. This limit can be disabled by setting it to
# 0.
# max-series-per-database = 1000000 # The maximum number of tag values per tag that are allowed before writes are dropped. This limit
# can prevent high cardinality tag values from being written to a measurement. This limit can be
# disabled by setting it to 0.
# max-values-per-tag = 100000 # Settings for the tsi1 index # The threshold, in bytes, when an index write-ahead log file will compact
# into an index file. Lower sizes will cause log files to be compacted more
# quickly and result in lower heap usage at the expense of write throughput.
# Higher sizes will be compacted less frequently, store more series in-memory,
# and provide higher write throughput.
# Valid size suffixes are k, m, or g (case insensitive, 1024 = 1k).
# Values without a size suffix are in bytes.
max-index-log-file-size = "1m" # The size of the internal cache used in the TSI index to store previously
# calculated series results. Cached results will be returned quickly from the cache rather
# than needing to be recalculated when a subsequent query with a matching tag key/value
# predicate is executed. Setting this value to 0 will disable the cache, which may
# lead to query performance issues.
# This value should only be increased if it is known that the set of regularly used
# tag key/value predicates across all measurements for a database is larger than 100. An
# increase in cache size may lead to an increase in heap usage.
series-id-set-cache-size = 100 ###
### [coordinator]
###
### Controls the clustering service configuration.
### [coordinator]
# The default time a write request will wait until a "timeout" error is returned to the caller.
# write-timeout = "10s" # The maximum number of concurrent queries allowed to be executing at one time. If a query is
# executed and exceeds this limit, an error is returned to the caller. This limit can be disabled
# by setting it to 0.
# max-concurrent-queries = 0 # The maximum time a query will is allowed to execute before being killed by the system. This limit
# can help prevent run away queries. Setting the value to 0 disables the limit.
query-timeout = "60s" # The time threshold when a query will be logged as a slow query. This limit can be set to help
# discover slow or resource intensive queries. Setting the value to 0 disables the slow query logging.
log-queries-after = "10s" # The maximum number of points a SELECT can process. A value of 0 will make
# the maximum point count unlimited. This will only be checked every second so queries will not
# be aborted immediately when hitting the limit.
# max-select-point = 0 # The maximum number of series a SELECT can run. A value of 0 will make the maximum series
# count unlimited.
# max-select-series = 0 # The maxium number of group by time bucket a SELECT can create. A value of zero will max the maximum
# number of buckets unlimited.
# max-select-buckets = 0 ###
### [retention]
###
### Controls the enforcement of retention policies for evicting old data.
### [retention]
# Determines whether retention policy enforcement enabled.
# enabled = true # The interval of time when retention policy enforcement checks run.
# check-interval = "30m" ###
### [shard-precreation]
###
### Controls the precreation of shards, so they are available before data arrives.
### Only shards that, after creation, will have both a start- and end-time in the
### future, will ever be created. Shards are never precreated that would be wholly
### or partially in the past. [shard-precreation]
# Determines whether shard pre-creation service is enabled.
# enabled = true # The interval of time when the check to pre-create new shards runs.
# check-interval = "10m" # The default period ahead of the endtime of a shard group that its successor
# group is created.
# advance-period = "30m" ###
### Controls the system self-monitoring, statistics and diagnostics.
###
### The internal database for monitoring data is created automatically if
### if it does not already exist. The target retention within this database
### is called 'monitor' and is also created with a retention period of 7 days
### and a replication factor of 1, if it does not exist. In all cases the
### this retention policy is configured as the default for the database. [monitor]
# Whether to record statistics internally.
# store-enabled = true # The destination database for recorded statistics
# store-database = "_internal" # The interval at which to record statistics
# store-interval = "10s" ###
### [http]
###
### Controls how the HTTP endpoints are configured. These are the primary
### mechanism for getting data into and out of InfluxDB.
### [http]
# Determines whether HTTP endpoint is enabled.
# enabled = true # Determines whether the Flux query endpoint is enabled.
# flux-enabled = false # Determines whether the Flux query logging is enabled.
# flux-log-enabled = false # The bind address used by the HTTP service.
# bind-address = ":8086" # Determines whether user authentication is enabled over HTTP/HTTPS.
# auth-enabled = false # The default realm sent back when issuing a basic auth challenge.
# realm = "InfluxDB" # Determines whether HTTP request logging is enabled.
# log-enabled = true # Determines whether the HTTP write request logs should be suppressed when the log is enabled.
# suppress-write-log = false # When HTTP request logging is enabled, this option specifies the path where
# log entries should be written. If unspecified, the default is to write to stderr, which
# intermingles HTTP logs with internal InfluxDB logging.
#
# If influxd is unable to access the specified path, it will log an error and fall back to writing
# the request log to stderr.
# access-log-path = "" # Filters which requests should be logged. Each filter is of the pattern NNN, NNX, or NXX where N is
# a number and X is a wildcard for any number. To filter all 5xx responses, use the string 5xx.
# If multiple filters are used, then only one has to match. The default is to have no filters which
# will cause every request to be printed.
# access-log-status-filters = [] # Determines whether detailed write logging is enabled.
# write-tracing = false # Determines whether the pprof endpoint is enabled. This endpoint is used for
# troubleshooting and monitoring.
# pprof-enabled = true # Enables a pprof endpoint that binds to localhost:6060 immediately on startup.
# This is only needed to debug startup issues.
# debug-pprof-enabled = false # Determines whether HTTPS is enabled.
# https-enabled = false # The SSL certificate to use when HTTPS is enabled.
# https-certificate = "/etc/ssl/influxdb.pem" # Use a separate private key location.
# https-private-key = "" # The JWT auth shared secret to validate requests using JSON web tokens.
# shared-secret = "" # The default chunk size for result sets that should be chunked.
# max-row-limit = 0 # The maximum number of HTTP connections that may be open at once. New connections that
# would exceed this limit are dropped. Setting this value to 0 disables the limit.
# max-connection-limit = 0 # Enable http service over unix domain socket
# unix-socket-enabled = false # The path of the unix domain socket.
# bind-socket = "/var/run/influxdb.sock" # The maximum size of a client request body, in bytes. Setting this value to 0 disables the limit.
# max-body-size = 25000000 # The maximum number of writes processed concurrently.
# Setting this to 0 disables the limit.
# max-concurrent-write-limit = 0 # The maximum number of writes queued for processing.
# Setting this to 0 disables the limit.
# max-enqueued-write-limit = 0 # The maximum duration for a write to wait in the queue to be processed.
# Setting this to 0 or setting max-concurrent-write-limit to 0 disables the limit.
# enqueued-write-timeout = 0 ###
### [logging]
###
### Controls how the logger emits logs to the output.
### [logging]
# Determines which log encoder to use for logs. Available options
# are auto, logfmt, and json. auto will use a more a more user-friendly
# output format if the output terminal is a TTY, but the format is not as
# easily machine-readable. When the output is a non-TTY, auto will use
# logfmt.
# format = "auto" # Determines which level of logs will be emitted. The available levels
# are error, warn, info, and debug. Logs that are equal to or above the
# specified level will be emitted.
# level = "info" # Suppresses the logo output that is printed when the program is started.
# The logo is always suppressed if STDOUT is not a TTY.
# suppress-logo = false ###
### [subscriber]
###
### Controls the subscriptions, which can be used to fork a copy of all data
### received by the InfluxDB host.
### [subscriber]
# Determines whether the subscriber service is enabled.
# enabled = true # The default timeout for HTTP writes to subscribers.
# http-timeout = "30s" # Allows insecure HTTPS connections to subscribers. This is useful when testing with self-
# signed certificates.
# insecure-skip-verify = false # The path to the PEM encoded CA certs file. If the empty string, the default system certs will be used
# ca-certs = "" # The number of writer goroutines processing the write channel.
# write-concurrency = 40 # The number of in-flight writes buffered in the write channel.
# write-buffer-size = 1000 ###
### [[graphite]]
###
### Controls one or many listeners for Graphite data.
### [[graphite]]
# Determines whether the graphite endpoint is enabled.
# enabled = false
# database = "graphite"
# retention-policy = ""
# bind-address = ":2003"
# protocol = "tcp"
# consistency-level = "one" # These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Batching
# will buffer points in memory if you have many coming in. # Flush if this many points get buffered
# batch-size = 5000 # number of batches that may be pending in memory
# batch-pending = 10 # Flush at least this often even if we haven't hit buffer limit
# batch-timeout = "1s" # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
# udp-read-buffer = 0 ### This string joins multiple matching 'measurement' values providing more control over the final measurement name.
# separator = "." ### Default tags that will be added to all metrics. These can be overridden at the template level
### or by tags extracted from metric
# tags = ["region=us-east", "zone=1c"] ### Each template line requires a template pattern. It can have an optional
### filter before the template and separated by spaces. It can also have optional extra
### tags following the template. Multiple tags should be separated by commas and no spaces
### similar to the line protocol format. There can be only one default template.
# templates = [
# "*.app env.service.resource.measurement",
# # Default template
# "server.*",
# ] ###
### [collectd]
###
### Controls one or many listeners for collectd data.
### [[collectd]]
# enabled = false
# bind-address = ":25826"
# database = "collectd"
# retention-policy = ""
#
# The collectd service supports either scanning a directory for multiple types
# db files, or specifying a single db file.
# typesdb = "/usr/local/share/collectd"
#
# security-level = "none"
# auth-file = "/etc/collectd/auth_file" # These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Batching
# will buffer points in memory if you have many coming in. # Flush if this many points get buffered
# batch-size = 5000 # Number of batches that may be pending in memory
# batch-pending = 10 # Flush at least this often even if we haven't hit buffer limit
# batch-timeout = "10s" # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
# read-buffer = 0 # Multi-value plugins can be handled two ways.
# "split" will parse and store the multi-value plugin data into separate measurements
# "join" will parse and store the multi-value plugin as a single multi-value measurement.
# "split" is the default behavior for backward compatability with previous versions of influxdb.
# parse-multivalue-plugin = "split"
###
### [opentsdb]
###
### Controls one or many listeners for OpenTSDB data.
### [[opentsdb]]
# enabled = false
# bind-address = ":4242"
# database = "opentsdb"
# retention-policy = ""
# consistency-level = "one"
# tls-enabled = false
# certificate= "/etc/ssl/influxdb.pem" # Log an error for every malformed point.
# log-point-errors = true # These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Only points
# metrics received over the telnet protocol undergo batching. # Flush if this many points get buffered
# batch-size = 1000 # Number of batches that may be pending in memory
# batch-pending = 5 # Flush at least this often even if we haven't hit buffer limit
# batch-timeout = "1s" ###
### [[udp]]
###
### Controls the listeners for InfluxDB line protocol data via UDP.
### [[udp]]
# enabled = false
# bind-address = ":8089"
# database = "udp"
# retention-policy = "" # InfluxDB precision for timestamps on received points ("" or "n", "u", "ms", "s", "m", "h")
# precision = "" # These next lines control how batching works. You should have this enabled
# otherwise you could get dropped metrics or poor performance. Batching
# will buffer points in memory if you have many coming in. # Flush if this many points get buffered
# batch-size = 5000 # Number of batches that may be pending in memory
# batch-pending = 10 # Will flush at least this often even if we haven't hit buffer limit
# batch-timeout = "1s" # UDP Read buffer size, 0 means OS default. UDP listener will fail if set above OS max.
# read-buffer = 0 ###
### [continuous_queries]
###
### Controls how continuous queries are run within InfluxDB.
### [continuous_queries]
# Determines whether the continuous query service is enabled.
# enabled = true # Controls whether queries are logged when executed by the CQ service.
# log-enabled = true # Controls whether queries are logged to the self-monitoring data store.
# query-stats-enabled = false # interval for how often continuous queries will be checked if they need to run
# run-interval = "1s" ###
### [tls]
###
### Global configuration settings for TLS in InfluxDB.
### [tls]
# Determines the available set of cipher suites. See https://golang.org/pkg/crypto/tls/#pkg-constants
# for a list of available ciphers, which depends on the version of Go (use the query
# SHOW DIAGNOSTICS to see the version of Go used to build InfluxDB). If not specified, uses
# the default settings from Go's crypto/tls package.
# ciphers = [
# "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305",
# "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
# ] # Minimum version of the tls protocol that will be negotiated. If not specified, uses the
# default settings from Go's crypto/tls package.
# min-version = "tls1.2" # Maximum version of the tls protocol that will be negotiated. If not specified, uses the
# default settings from Go's crypto/tls package.
# max-version = "tls1.2"
7、rsyslog配置
cat >/etc/rsyslog.d/influxd.conf <<EOF
:programname, contains, "influxd" /var/log/influxdb/influxd.log
:programname, contains, "influxd" ~
EOF
systemctl restart rsyslog
- rsyslog配置说明
举例
Mar 10 14:47:04 vm-hp LogHeader[8261]: Hello, Logger
支持的模板属性变量输出如下
msg: Hello, Logger,
rawmsg: <175>Mar 10 15:52:49 LogHeader[13845]: Hello, Logger,
HOSTNAME: vm-28-234-pro01-hp,
FROMHOST: vm-28-234-pro01-hp,
syslogtag: LogHeader[13845]:,
programname: LogHeader,
PRI: 175,
PRI-text: local5.debug,
IUT: 1,
syslogfacility: 21,
syslogfacility-text: local5,
syslogseverity: 7,
syslogseverity-text: debug,
timereported: Mar 10 15:52:49,
TIMESTAMP: Mar 10 15:52:49,
timegenerated: Mar 10 15:52:49,
PROTOCOL-VERSION: 0,
STRUCTURED-DATA: -,
APP-NAME: LogHeader,
PROCID: 13845,
MSGID: -
参考:https://aicode.cc/shi-yongrsyslog-guan-li-ri-zhi.html
8、启动服务
启动服务 systemctl start influxd
停止服务 systemctl stop influxd
重启服务 systemctl restart influxd
influxdb-1.7.8(centos 7) 部署的更多相关文章
- 在CentOS上部署kubernetes1.9.0集群
原文链接: https://jimmysong.io/kubernetes-handbook/cloud-native/play-with-kubernetes.html (在CentOS上部署kub ...
- CentOS 7部署flume
CentOS 7部署flume 准备工作: 安装java并设置java环境变量,在`/etc/profile`中加入 export JAVA_HOME=/usr/java/jdk1.8.0_65 ex ...
- CentOS 7部署Kafka和Kafka集群
CentOS 7部署Kafka和Kafka集群 注意事项 需要启动多个shell脚本交互客户端进行验证,运行中的客户端不要停止. 准备工作: 安装java并设置java环境变量,在`/etc/prof ...
- 在centos中部署jenkins
在centos中部署jenkins,需要的环境:安装jdk,Apache-tomcat 这两步我前面文章里已写,再次忽略 到官网下载最新的jenkins 我这里的是 jenkins.war 把该文件 ...
- Centos 上部署 tomcat7
在 Centos 上部署 tomcat7 搜索tomcat,选下面红色框框的官网 选箭头指着的版本7, 选 tar.gz 格式, 下载完压缩包,使用 ftpx 工具,放在 centos 的 /opt ...
- SSM 项目从搭建爬坑到 CentOS 服务器部署 - 速查手册
SSM 项目从搭建爬坑到 CentOS 服务器部署 - 速查手册 提示: (1)CSDN 博客左边有操作工具条上有文章目录 (2)SSM 指 Spring,Spring MVC,MyBatis Mav ...
- CentOS上部署Django+Nginx+Uwsgi环境
在CentOS上部署Django+Nginx+Uwsgi环境 奇谭 2016-09-01 评论 Linux python django nginx uwsgi VirtualEnv的作用:创建隔 ...
- Linux CentOS下部署Java Web项目
本文讲解如何在Linux CentOS下部署Java Web项目的步骤. 一.环境准备: (1)Linux CentOS (2)apache-tomcat-9.0.10 (3)XShell 二.启动t ...
- CentOS 7 部署 ASP.NET Core 应用程序
原文:CentOS 7 部署 ASP.NET Core 应用程序 看了几篇大牛写的关于 Linux 部署 ASP.NET Core 程序的文章,今天来实战演练一下.2017年最后一个工作日,提前预祝大 ...
- java部署系列:CentOS下部署Java7/Java8
一.前言 1.本文主要内容 CentOS下部署OracleJDK CentOS下部署OpenJDK 2.适用范围与本篇环境 适用范围 1.CentOS 6+2.Java 7+ 本篇环境 1.CentO ...
随机推荐
- Python推导表达式、迭代器、生成器、模块和包
推导表达式 yield用法 模块的概念和导入方法 包和包管理 推导表达式(利用for,一个一个地放入数据) 列表推导 集合推导 字典推导 迭代器 迭代 for 迭代变量 in 可迭代对象 每一次循环都 ...
- Python函数基础和函数参数
函数的定义和函数的调用 return的作用 三种参数的定义 常用的内置函数 len() 函数基础 函数的定义 def 函数名(参数): pass return 表达式 pass在这里表示什么都没有,不 ...
- itest(爱测试) 3.5.0 发布,开源BUG 跟踪管理& 敏捷测试管理软件
v3.5.0 下载地址 :itest下载 itest 简介:查看简介 V3.5.0 增加了 9个功能增强,和17个BUG修复 ,详情如下所述. 9个功能增强 : (1)增加xmind(思维导图) 转E ...
- 在python的虚拟环境venv中使用gunicorn
昨天遇到的问题,一个服务器上有好几个虚拟机环境. 我active进一个虚拟环境,安装了新的三方库之后, 使用gunicorn启动django服务, 但还是死活提示没有安装这个三方库. 一开始没有找到原 ...
- 【HDU1814】Peaceful Commission(2-sat+暴力染色)
传送门 \(2-sat\)的模板题,首先得出题目中的二元关系为:对于有矛盾的\(x_i,x_j\),至多选择一个,那么连边\(x_i\rightarrow x_j',x_j\rightarrow x_ ...
- 【洛谷P4251】[SCOI2015]小凸玩矩阵(二分+二分图匹配)
洛谷 题意: 给出一个\(n*m\)的矩阵\(A\).现要从中选出\(n\)个数,任意两个数不能在同一行或者同一列. 现在问选出的\(n\)个数中第\(k\)大的数的最小值是多少. 思路: 显然二分一 ...
- 第十五周博客作业 <西北师范大学| 周安伟>
第十五周作业 助教博客链接https://home.cnblogs.com/u/zaw-315/ 作业要求链接https://www.cnblogs.com/nwnu-daizh/p/10946673 ...
- SpringMVC拦截器(四)
拦截器,本质类似于AOP,主要的应用场景: 日志记录:记录请求信息的日志,以便进行信息监控.信息统计.计算PV等. 权限检查:如登录检测,进入处理器检测是否登录,没有登录返回登录页面. 性能监控:记录 ...
- NOIP 2011 铺地毯
洛谷 P1003 铺地毯 洛谷传送门 JDOJ 1744: [NOIP2011]铺地毯 D1 T1 JDOJ传送门 Description 为了准备一个独特的颁奖典礼,组织者在会场的一片矩形区域(可看 ...
- Python process (进程)
进程 (process) 进程是对各种资源管理的集合,包含对各种资源的调用.内存的管理.网络接口的调用 进程要操作 CPU 必须先启动一个线程,启动一个进程的时候会自动创建一个线程,进程里的第一个线程 ...