您好,登錄后才能下訂單哦!
這篇“docker compose安裝掛載本地文件啟動mariadb問題怎么解決”文章的知識點大部分人都不太理解,所以小編給大家總結了以下內容,內容詳細,步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“docker compose安裝掛載本地文件啟動mariadb問題怎么解決”文章吧。
docker pull mariadb:xxx
注:記得使用chown授權避免權限不足無法寫入的錯誤
[mariadbd] skip-host-cache skip-name-resolve [mysqld] datadir=/var/lib/mysql log-error=/var/log/mysql/mysqld.log pid-file=/var/run/mysqld/mysqld.pid log_bin=/var/log/mysql/mysql-bin binlog_format=row max-binlog-size=512m expire_logs_days=180 log_bin_index=/var/log/mysql/mysql-bin.index slow_query_log_file=/var/log/mysql/mariadb-slow.log long_query_time = 0.5 server-id=1 skip-external-locking max_connections = 1000 connect_timeout = 5 wait_timeout = 600 max_allowed_packet = 16M thread_cache_size = 128 sort_buffer_size = 4M bulk_insert_buffer_size = 16M tmp_table_size = 32M max_heap_table_size = 32M default_storage_engine = InnoDB # you can't just change log file size, requires special procedure #innodb_log_file_size = 50M #innodb_buffer_pool_size = 256M innodb_log_buffer_size = 8M innodb_file_per_table = 1 innodb_open_files = 400 innodb_io_capacity = 400 innodb_flush_method = O_DIRECT #tunning memory innodb_buffer_pool_size = 512m innodb_buffer_pool_instances=10 sort_buffer_size=12M read_buffer_size=8M read_rnd_buffer_size=50M join_buffer_size=8M query_cache_size=256M thread_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問題怎么解決”這篇文章的內容,相信大家都有了一定的了解,希望小編分享的內容對大家有幫助,若想了解更多相關的知識內容,請關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。