首页 技术 正文
技术 2022年11月18日
0 收藏 364 点赞 2,332 浏览 5711 个字

安装mysql

mkdir /opt/mysql /opt/mysql/etc /opt/mysql/data
docker run -itd --name mariadb -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -v $(pwd)/mysql/etc/my.cnf:/etc/mysql/my.cnf -v $(pwd)/mysql/data:/var/lib/mysql mariadb:10.5.4

 

配置文件

#
[client]
default-character-set = utf8mb4[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.socklog-error = /var/lib/mysql/mysql_error.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql_slow.log
#skip-grant-tables
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemdsql-mode='NO_ENGINE_SUBSTITUTION'init-connect = 'SET NAMES utf8mb4'
character-set-server = utf8mb4server-id = 1
log_bin=/var/lib/mysql/mysql-bin
log_bin_index=/var/lib/mysql/mysql-bin.index
expire-logs-days = 7
sync-binlog = 1# SAFETY #
max-allowed-packet = 1024M
max-connect-errors = 1000000# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 1500
thread-cache-size = 50
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 4096# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 512M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 3G
innodb_lock_wait_timeout = 500[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid#
# include all files from the config directory
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

  

安装mongodb

mkdir /opt/mongodb/data /opt/mongodb/etc /opt/mongodb/logs
docker run -itd --rm -v /opt/mongodb/data:/data/db -v /opt/mongodb/etc:/etc/mongo -v /opt/mongodb/logs:/var/log/mongodb -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin -p 27017:27017 mongo:4.2.8 --config /etc/mongo/mongod.conf

  

配置文件

#
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /data/db
journal:
enabled: true
directoryPerDB: true
# engine:# mmapv1:# wiredTiger:# how the process runsprocessManagement:
# fork: true # fork and run in background
# pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile timeZoneInfo: /usr/share/zoneinfo
# network interfaces
net:
port: 27017
bindIp: 0.0.0.0 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.#security:
security:
authorization: enabled
# keyFile: /data1/mongodb/keyfile
#operationProfiling:
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:

  

安装redis

docker run -itd  -v /opt/redis/etc/redis.conf:/usr/local/etc/redis/redis.conf -v /opt/redis/data/:/data -p 6379:6379 redis:5.0.9 redis-server /usr/local/etc/redis/redis.conf

  

配置文件

bind 0.0.0.0
protected-mode yes
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize no
supervised no
pidfile /var/run/redis_6379.pid
loglevel notice
logfile "/data/redis.log"
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir ./
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
replica-priority 100
requirepass admin@2020
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes

  

安装rabbitmq

docker run -itd --rm --hostname rabbitmq-server -v /opt/rabbitmq:/var/lib/rabbitmq -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=rabbitmq@admin -p 15672:15672 -p 5672:5672 rabbitmq:3.8.5-management

  

gitea&&gogs

docker run -itd -e USER_UID=1000 -e USER_GID=1000    -v /opt/gitea:/data -v /etc/timezone:/etc/timezone:ro -v  /etc/localtime:/etc/localtime:ro    -p 3000:3000 -p 222:22 --restart=always gitea/gitea:latest

zookeeper

mkdir /data/zookeeper  /data/zookeeper/conf /data/zookeeper/data
chmod 777 /data/zookeeper/datadocker run -itd -p 2181:2181 -e ALLOW_ANONYMOUS_LOGIN=yes --name zookeeper -v $(pwd)/data:/bitnami/zookeeper/data -v $(pwd)/conf/zoo.cfg:/opt/bitnami/zookeeper/conf/zoo.cfg bitnami/zookeeper:3.6.2

  

配置

tickTime=2000
initLimit=10
syncLimit=5
dataDir=/bitnami/zookeeper/data
clientPort=2181
maxClientCnxns=60
autopurge.snapRetainCount=3
autopurge.purgeInterval=1

 kafka

docker run -itd --name kafka --restart always\
--net host \
-p 9092:9092 \
-e ALLOW_PLAINTEXT_LISTENER=yes \
-e KAFKA_CFG_ZOOKEEPER_CONNECT=xx.xx:2181 \
-e KAFKA_BROKER_ID=1 \
-e KAFKA_LISTENERS=PLAINTEXT://xx:9092 \
-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://xx:9092 \
-v $(pwd)/data:/bitnami/kafka/data \
bitnami/kafka:2.6.0

  

redis

docker run -itd --name redis --rm\
--net host \
-p 6379:6379 \
-e ALLOW_EMPTY_PASSWORD=yes \
-v /data/redis/data:/bitnami/redis/data \
bitnami/redis:latestdocker run -idt --rm --name redis-sentinel \
-p 26379:26379 \
--net host \
-e REDIS_MASTER_HOST=172.16.xx.xx \
bitnami/redis-sentinel:latest

 

clickhouse

docker run -itd --rm --name clickhouse-server -p 9004:9004 -p 8123:8123 -p 9000:9000  --ulimit nofile=262144:262144 -v $(pwd)/conf/config.xml:/etc/clickhouse-server/config.xml --volume=$(pwd)/data:/var/lib/clickhouse yandex/clickhouse-server:20.6.10.2

  

 

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,557
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,406
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898