Nginx
安装: sudo apt-get install nginx
查看:nginx -v
启动:service nginx start
关闭:service nginx stop
-
相关文件:
/usr/sbin/nginx 主程序
/etc/nginx 存放配置文件
/usr/share/nginx 存放静态文件
/var/log/nginx:存放日志
Maven
附链接:安装Maven
Gradle
手动安装gradle
Jenkins
前提:安装jdk
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="shell" cid="n31" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">#添加存储库密钥:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -添加到source list
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
更新
sudo apt-get update
安装
sudo apt-get install jenkins</pre>
Redis
安装:sudo apt-get install redis-server
启动:redis-server
关闭:redis-cli [-p 6379] shutdown
相关文件:/etc/redis/redis.conf
进入客户端:redis-cli
RabbitMQ
安装支持:sudo apt-get install erlang-nox
安装:sudo apt-get install rabbitmq-server
启动:sudo rabbitmq-server start
停止:sudo rabbitmq-server stop
重启:sudo rabbitmq-server restart
安装管理页面:在rabbitmq安装目录下执行 sudo rabbitmq-plugins enable rabbitmq_management
创建admin用户: sudo rabbitmqctl add_user admin admin
赋权限: sudo rabbitmqctl set_user_tags admin administrator sudo rabbitmqctl set_permissions -p / admin '.' '.' '.*'
附链接:安装RabbitMQ
Mysql8
-
预准备:添加MySQL APT存储库
wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb 注:中间弹窗直接↓到点”OK“
sudo apt-get update
安装:sudo apt-get install mysql-server 注:其中两个弹窗,第一个是确认密码(设置数据库密码),另一个是选择加密方式,工具较新选第一个,较老选第二个
更改加密方式: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码';
授权远程连接: grant all on . to 'root'@'%'; flush privileges;
添加新用户:
CREATE user 'goddess'@'%' IDENTIFIED BY 'goddess';
授予crud权限:
GRANT select,insert,update,delete on *.* to 'goddess'@'%';
Docker
-
安装支持:
sudo apt-get install docker.io
sudo apt-get update
-
安装包允许apt通过HTTPS使用仓库:
sudo dpkg --configure -a
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
添加Docker官方GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
设置Docker稳定版仓库:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
更新apt:
sudo apt-get update
安装社区版:
sudo apt install docker-ce docker-ce-cli containerd.io
查看版本:
docker --version
开机自启动:
sudo systemctl enable ssh
docker安装RabbitMQ:
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n118" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">docker run -itd --name rabbitmq -p 15672:15672 -p 5672:5672 rabbitmq:management</pre>
docker安装Mysql:
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n124" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">docker run -itd --name mysql -p 3306:3306 --privileged=true
-v /home/hicat/data/mysql/log:/var/log/mysql
-v /home/hicat/data/mysql/data:/var/lib/mysql
-v /home/hicat/data/mysql/conf:/etc/mysql/conf.d
-e MYSQL_ROOT_PASSWORD=1109 mysql</pre>
docker安装postgreSql:
- 安装命令: docker run --name postgres -e POSTGRES_PASSWORD=1109 -p 5432:5432 -d postgres
docker安装Zookeeper:
- 安装命令:docker run -itd --name zookeeper -p 2181:2181 -e ALLOW_ANONYMOUS_LOGIN=yes zookeeper
docker安装Kafka:
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n136" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">docker run -d --name kafka-server
-p 9092:9092
-e ALLOW_PLAINTEXT_LISTENER=yes
-e KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
-e KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://172.21.175.225:9092
bitnami/kafka:latest
</pre>
docker安装Zimg:
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n143" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">docker run -it -d -p 4869:4869
-v /home/goddess/data/zimg/data:/zimg/bin/img
--name zimg iknow0612/zimg</pre>
docker安装Mongodb
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n148" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">docker run -itd -p 27017:27017 --name mongodb
--privileged=true
-v /home/goddess/data/mongodb/data:/data/db
mongo --auth</pre> -
创建root用户:
进入控制台:
docker exec -it mongodb mongosh admin
use admin
db.createUser({user:"root",pwd:"1109",roles:[{role:"root",db:"admin"}],mechanisms:["SCRAM-SHA-1"]})
-
创建指定数据库管理用户:
use dbname
db.createUser({user:"goddess",pwd:"goddess",roles:[{role:"dbAdmin",db:"dbname"}],mechanisms:["SCRAM-SHA-1"]})
-
创建指定数据库普通用户:
use dbname
db.createUser({user:"goddess",pwd:"goddess",roles:[{role:"readWrite",db:"dbname"}],mechanisms:["SCRAM-SHA-1"]})
更改密码:
db.changeUserPassword('tank2','test')
docker安装elasticsearch
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n178" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">docker run --name elastic8 -d --privileged -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" -p 9200:9200 -p 9300:9300 elasticsearch:8.5.2</pre>
-
安装zk分词:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n181" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;"># 进入控制台
docker exec -it elastic8 /bin/bash安装zk分词插件
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.5.2/elasticsearch-analysis-ik-8.5.2.zip
查看
cd plugins/</pre>
-
密码:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n184" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;"># 生成超级管理员elastic的密码
docker exec -it elastic8 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic生成enrollment-token(目前只发现kibana登录需要使用)
docker exec -it elastic8 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
为kibana生成elastic的密码
docker exec -it elastic8 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u kibana_system</pre>
docker安装kibana
安装命令:
docker run -d --name kibana8 -p 5601:5601 -e "I18N_LOCALE=zh-CN" kibana:8.5.2
口令:
docker exec -it kibana8 /usr/share/kibana/bin/kibana-verification-code
docker安装logstash
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="shell" cid="n195" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">docker run -it -d --name logstash8
-v /home/goddess/data/logstash/data:/usr/share/logstash/data
-v /home/goddess/data/logstash/pipeline:/usr/share/logstash/pipeline
logstash:8.5.2
</pre>
docker安装rocketmq
安装命令:
NameServer:
docker run -d -p 9876:9876 --name rocketmq-server foxiswho/rocketmq:server-4.7.0
Broker:
docker run -d -p 10911:10911 -p 10909:10909 --name rocketmq-broker --link rocketmq-server:namesrv -e "NAMESRV_ADDR=namesrv:9876" -e "JAVA_OPTS=-Duser.home=/opt" -e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m" -v /home/goddess/broker.conf:/etc/rocketmq/broker.conf foxiswho/rocketmq:broker-4.7.0
安装控制台:
docker run -d -p 8080:8080 --name rocketmq-console --link rocketmq-server:namesrv -e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" -t apacherocketmq/rocketmq-console:2.0.0
示例:https://www.cnblogs.com/gmhappy/p/13457026.html
docker 安装rancher
安装命令:
docker run -d --privileged -name rancher -p 80:80 -p 443:443 \ rancher/rancher:v2.5.12
docker 安装nacos
-
安装命令:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n217" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit;">docker run --name nacos -d -p 8848:8848
--env MODE=standalone
--env JVM_XMS=256m
--env JVM_XMX=256m
nacos/nacos-server</pre>
docker安装sonarqube
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="shell" cid="n220" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">sudo docker run -d -p 9000:9000
--name sonarqube
--link postgres
--privileged=true
-e sonar.jdbc.url=jdbc:postgresql://postgres:5432/sonar
-e sonar.jdbc.username=postgres
-e sonar.jdbc.password=1109 sonarqube</pre>
解决报错max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n222" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">vim /etc/sysctl.conf
添加参数:新增如下内容在sysctl.conf文件中,当前用户拥有的内存权限大小
vm.max_map_count=262144
重启生效:让系统控制权限配置生效
sysctl -p</pre>
docker安装文件服务器minio:
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="shell" cid="n224" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">#先创建挂载的目录:
mkdir -p /home/goddess/data/minio/data
mkdir -p /home/goddess/data/minio/config
执行docker命令
MINIO_ROOT_USER、MINIO_ROOT_PASSWORD 设置后台管理登录账号和密码
9000端口是api的访问端口、9001是管理页面的端口
docker run -d --name minio
-p 9000:9000
-p 9001:9001
-v /home/goddess/data/minio/data:/data
-v /home/goddess/data/minio/config:/root/.minio
-e MINIO_ROOT_USER=minio
-e MINIO_ROOT_PASSWORD=minio123
minio/minio server /data --console-address ":9001" -address ":9000"</pre>
docker安装clickhouse
参考链接:https://www.cnblogs.com/it1042290135/p/16202478.html
<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="shell" cid="n227" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">sudo docker pull clickhouse/clickhouse-server
sudo docker cp clickhouse:/etc/clickhouse-server/users.xml /home/goddess/data/clickhouse/conf/users.xml
sudo docker cp clickhouse:/etc/clickhouse-server/config.xml /home/goddess/data/clickhouse/conf/config.xml
sudo docker run -d --name clickhouse -p 8123:8123 -p 9009:9009 -p 9000:9000 --ulimit nofile=262144:262144 clickhouse/clickhouse-server
sudo docker run -d --name clickhouse -p 8123:8123 -p 9009:9009 -p 9090:9000
--ulimit nofile=262144:262144
--volume=/home/goddess/data/clickhouse/data:/var/lib/clickhouse
--volume=/home/goddess/data/clickhouse/log:/var/log/clickhouse-server
--volume=/home/goddess/data/clickhouse/conf/config.xml:/etc/clickhouse-server/config.xml
--volume=/home/goddess/data/clickhouse/conf/users.xml:/etc/clickhouse-server/users.xml
clickhouse/clickhouse-server
</pre>