<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Stroom – mysql</title>
    <link>/tags/mysql/</link>
    <description>Recent content in mysql on Stroom</description>
    <generator>Hugo -- gohugo.io</generator>
    <lastBuildDate>Fri, 04 Feb 2022 00:00:00 +0000</lastBuildDate>
    
	  <atom:link href="/tags/mysql/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: Securing Stroom</title>
      <link>/docs/install-guide/setup/securing-stroom/</link>
      <pubDate>Fri, 04 Feb 2022 00:00:00 +0000</pubDate>
      
      <guid>/docs/install-guide/setup/securing-stroom/</guid>
      <description>
        
        
        &lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt; This document was written for stroom v4/5. Some parts may not be applicable for v6+.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;firewall&#34;&gt;Firewall&lt;/h2&gt;
&lt;p&gt;The following firewall configuration is recommended:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Outside cluster drop all access except ports HTTP 80, HTTPS 443, and any other system ports your require SSH, etc.&lt;/li&gt;
&lt;li&gt;Within cluster allow all access&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This will enable nodes within the cluster to communicate on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;8080 - Stroom HTTP.&lt;/li&gt;
&lt;li&gt;8081 - Stroom HTTP (admin).&lt;/li&gt;
&lt;li&gt;8090 - Stroom Proxy HTTP.&lt;/li&gt;
&lt;li&gt;8091 - Stroom Proxy HTTP (admin).&lt;/li&gt;
&lt;li&gt;3306 - MySQL&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;mysql&#34;&gt;MySQL&lt;/h2&gt;

&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;TODO&lt;/h4&gt;

    Update this for MySQL 8

&lt;/div&gt;

&lt;p&gt;It is recommended that you run &lt;code&gt;mysql_secure_installation&lt;/code&gt; to set a root password and remove the test database:&lt;/p&gt;

  






&lt;div class=&#34;code-toolbar&#34;&gt;
  &lt;pre 
    class=&#34;command-line language-bash&#34; 
    data-user=&#34;user&#34; 
    data-host=&#34;localhost&#34; 
    data-continuation-str=&#34;\&#34;
    data-filter-output=&#34;(out)&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;mysql_secure_installation&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;When prompted, answer as follows (providing a root password when asked):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Set root password? → &lt;strong&gt;Y&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Remove anonymous users? → &lt;strong&gt;Y&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Disallow root login remotely? → &lt;strong&gt;Y&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Remove test database and access to it? → &lt;strong&gt;Y&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Reload privilege tables now? → &lt;strong&gt;Y&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: MySQL Configuration</title>
      <link>/docs/install-guide/configuration/configuring-mysql/</link>
      <pubDate>Mon, 07 Jun 2021 00:00:00 +0000</pubDate>
      
      <guid>/docs/install-guide/configuration/configuring-mysql/</guid>
      <description>
        
        
        
&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;See Also&lt;/h4&gt;
&lt;div class=&#34;alert-content&#34;&gt;
  
  &lt;p&gt;&lt;a href=&#34;../../docs/install-guide/setup/mysql-server-setup/&#34;&gt;MySQL Server Setup&lt;/a&gt;
&lt;span class=&#34;external-link&#34;&gt;
&lt;a href=&#34;https://dev.mysql.com/doc/refman/8.0/en/server-administration.html&#34; target=&#34;_blank&#34; class=&#34;external-link&#34; title=&#34;MySQL Server Administration (external link to https://dev.mysql.com/doc/refman/8.0/en/server-administration.html)&#34;&gt;
&lt;span&gt;MySQL Server Administration&lt;/span&gt;
&lt;i class=&#34;external-link-icon fas fa-external-link-alt fa-sm text-secondary&#34;&gt;&lt;/i&gt;
&lt;/a&gt;
&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&#34;general-configuration&#34;&gt;General configuration&lt;/h2&gt;
&lt;p&gt;MySQL is configured via the &lt;code&gt;.cnf&lt;/code&gt; file which is typically located in one of these locations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/etc/my.cnf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/mysql/my.cnf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$MYSQL_HOME/my.cnf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;data dir&amp;gt;/my.cnf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;~/.my.cnf&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;key-configuration-properties&#34;&gt;Key configuration properties&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;lower_case_table_names&lt;/code&gt; - This property controls how the tables are stored on the filesystem and the case-sensitivity of table names in SQL.
A value of &lt;code&gt;0&lt;/code&gt; means tables are stored on the filesystem in the case used in CREATE TABLE and sql is case sensitive.
This is the default in linux and is the preferred value for deployments of stroom of v7+.
A value of &lt;code&gt;1&lt;/code&gt; means tables are stored on the filesystem in lowercase but sql is case insensitive.
See also &lt;span class=&#34;external-link&#34;&gt;
  &lt;a href=&#34;https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html&#34; target=&#34;_blank&#34; class=&#34;external-link&#34; title=&#34;Identifier Case Sensitivity (external link to https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html)&#34;&gt;
    &lt;span&gt;Identifier Case Sensitivity&lt;/span&gt;
    &lt;i class=&#34;external-link-icon fas fa-external-link-alt fa-sm text-secondary&#34;&gt;&lt;/i&gt;
  &lt;/a&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;max_connections&lt;/code&gt; - The maximum permitted number of simultaneous client connections.
For a clustered deployment of stroom, the default value of 151 will typically be too low.
Each stroom node will hold a pool of open database connections for its use, therefore with a large number of stroom nodes and a big connection pool the total number of connections can be very large.
This property should be set taking into account the values of the stroom properties of the form &lt;code&gt;*.db.connectionPool.maxPoolSize&lt;/code&gt;.
See also &lt;span class=&#34;external-link&#34;&gt;
  &lt;a href=&#34;https://dev.mysql.com/doc/refman/8.0/en/connection-interfaces.html&#34; target=&#34;_blank&#34; class=&#34;external-link&#34; title=&#34;Connection Interfaces (external link to https://dev.mysql.com/doc/refman/8.0/en/connection-interfaces.html)&#34;&gt;
    &lt;span&gt;Connection Interfaces&lt;/span&gt;
    &lt;i class=&#34;external-link-icon fas fa-external-link-alt fa-sm text-secondary&#34;&gt;&lt;/i&gt;
  &lt;/a&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;innodb_buffer_pool_size&lt;/code&gt;/&lt;code&gt;innodb_buffer_pool_instances&lt;/code&gt; - Controls the amount of memory available to MySQL for caching table/index data.
Typically this will be set to 80% of available RAM, assuming MySQL is running on a dedicated host and the total amount of table/index data is greater than 80% of available RAM.
&lt;em&gt;Note&lt;/em&gt;: &lt;code&gt;innodb_buffer_pool_size&lt;/code&gt; must be set to a value that is equal to or a multiple of &lt;code&gt;innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances&lt;/code&gt;.
See also &lt;span class=&#34;external-link&#34;&gt;
  &lt;a href=&#34;https://dev.mysql.com/doc/refman/8.0/en/innodb-buffer-pool-resize.html&#34; target=&#34;_blank&#34; class=&#34;external-link&#34; title=&#34;Configuring InnoDB Buffer Pool Size (external link to https://dev.mysql.com/doc/refman/8.0/en/innodb-buffer-pool-resize.html)&#34;&gt;
    &lt;span&gt;Configuring InnoDB Buffer Pool Size&lt;/span&gt;
    &lt;i class=&#34;external-link-icon fas fa-external-link-alt fa-sm text-secondary&#34;&gt;&lt;/i&gt;
  &lt;/a&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;TODO&lt;/h4&gt;

    Add additional key configuration items

&lt;/div&gt;

&lt;h2 id=&#34;deploying-without-docker&#34;&gt;Deploying without Docker&lt;/h2&gt;
&lt;p&gt;When MySQL is deployed without a docker stack then MySQL should be installed and configured according to the MySQL documentation.
How MySQL is deployed and configured will depend on the requirements of the environment, e.g. clustered, primary/standby, etc.&lt;/p&gt;
&lt;h2 id=&#34;as-part-of-a-docker-stack&#34;&gt;As part of a docker stack&lt;/h2&gt;
&lt;p&gt;Where a stroom docker stack includes stroom-all-dbs (MySQL) the MySQL instance is configured via the &lt;code&gt;.cnf&lt;/code&gt; file.
The &lt;code&gt;.cnf&lt;/code&gt; file is located in &lt;code&gt;volumes/stroom-all-dbs/conf/stroom-all-dbs.cnf&lt;/code&gt;.
This file is read-only to the container and will be read on container start.&lt;/p&gt;
&lt;h3 id=&#34;database-initialisation&#34;&gt;Database initialisation&lt;/h3&gt;
&lt;p&gt;When the container is started for the first time the database will be initialised with the root user account.
It will also then run any scripts found in &lt;code&gt;volumes/stroom-all-dbs/init/stroom&lt;/code&gt;.
The scripts in here will be run in alphabetical order.
Scripts of the form &lt;code&gt;.sh&lt;/code&gt;, &lt;code&gt;.sql&lt;/code&gt;, &lt;code&gt;.sql.gz&lt;/code&gt; and &lt;code&gt;.sql.template&lt;/code&gt; are supported.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;.sql.template&lt;/code&gt; files are proprietary to stroom stacks and are just templated &lt;code&gt;.sql&lt;/code&gt; files.
They can contain tags of the form &lt;code&gt;&amp;lt;&amp;lt;&amp;lt;ENV_VAR_NAME&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; which will be replaced with the value of the named environment variable that has been set in the container.&lt;/p&gt;
&lt;p&gt;If you need to add additional database users then either add them to &lt;code&gt;volumes/stroom-all-dbs/init/stroom/001_create_databases.sql.template&lt;/code&gt; or create additional scripts/templates in that directory.&lt;/p&gt;
&lt;p&gt;The script that controls this templating is &lt;code&gt;volumes/stroom-all-dbs/init/000_stroom_init.sh&lt;/code&gt;.
This script MUST not have its executable bit set else it will be executed rather than being sourced by the MySQL entry point scripts and will then not work.&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
