这篇“Docker compose安装挂载本地文件启动mariadb问题怎么解决”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇
这篇“Docker compose安装挂载本地文件启动mariadb问题怎么解决”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“docker compose安装挂载本地文件启动mariadb问题怎么解决”文章吧。
docker pull mariadb:xxx
注:记得使用chown授权避免权限不足无法写入的错误
[mariadbd]skip-host-cacheskip-name-resolve[mysqld]datadir=/var/lib/Mysqllog-error=/var/log/mysql/mysqld.logpid-file=/var/run/mysqld/mysqld.pidlog_bin=/var/log/mysql/mysql-binbinlog_fORMat=rowmax-binlog-size=512mexpire_logs_days=180log_bin_index=/var/log/mysql/mysql-bin.indexslow_query_log_file=/var/log/mysql/mariadb-slow.loglong_query_time = 0.5server-id=1skip-external-locking max_connections = 1000connect_timeout = 5wait_timeout = 600max_allowed_packet = 16Mthread_cache_size = 128sort_buffer_size = 4Mbulk_insert_buffer_size = 16Mtmp_table_size = 32Mmax_heap_table_size = 32Mdefault_storage_engine = InnoDB# you can't just change log file size, requires special procedure#innodb_log_file_size = 50M#innodb_buffer_pool_size = 256Minnodb_log_buffer_size = 8Minnodb_file_per_table = 1innodb_open_files = 400innodb_io_capacity = 400innodb_flush_method = O_DIRECT#tunning memoryinnodb_buffer_pool_size = 512minnodb_buffer_pool_instances=10sort_buffer_size=12Mread_buffer_size=8Mread_rnd_buffer_size=50Mjoin_buffer_size=8MQuery_cache_size=256Mthread_concurrency=4 #CPU核数 * 2!include /etc/mysql/mariadb.cnf!includedir /etc/mysql/conf.d/
创建compose文件
mariadb集群搭建—Galera Cluster+ProxySQL
version: '3.7'services: mariadb: image: mariadb:10.6.5 container_name: "mariadb_alone" restart: always environment: MYSQL_USER: "root" MYSQL_ROOT_PASSWord: "199651Ch@" TZ: "Asia/Shanghai" ports: - "3306:3306" user: "0" volumes: # 容器与宿主机时间同步 - /etc/localtime:/etc/localtime - ./data:/var/lib/mysql - ./log:/var/log/mysql - ./run:/var/run/mysqld - ./conf/mariadb.cnf:/etc/mariadb.cnf
docker-compose up -d 后台启动
以上就是关于“docker compose安装挂载本地文件启动mariadb问题怎么解决”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注编程网精选频道。
--结束END--
本文标题: docker compose安装挂载本地文件启动mariadb问题怎么解决
本文链接: https://lsjlt.com/news/351847.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0