You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ch...@apache.org on 2012/09/25 19:42:25 UTC

[2/11] git commit: docs: Update the documentation for the database installtion.

docs: Update the documentation for the database installtion.

This adds more documentation about installing the MySQL database locally
or on an external node.

It also adds Ubuntu documentation.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/5c4cf118
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/5c4cf118
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/5c4cf118

Branch: refs/heads/junit-tests
Commit: 5c4cf11860bb1103d6e660ee4d72b3f329cfefd7
Parents: 9f2bd07
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Tue Sep 25 16:56:49 2012 +0200
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Tue Sep 25 16:56:49 2012 +0200

----------------------------------------------------------------------
 .../management-server-install-db-external.xml      |   99 ++++++++-------
 docs/en-US/management-server-install-db-local.xml  |   82 +++++--------
 docs/en-US/management-server-install-db.xml        |   34 +++++
 docs/en-US/management-server-install-flow.xml      |    3 +-
 .../en-US/management-server-install-multi-node.xml |    2 +-
 5 files changed, 121 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5c4cf118/docs/en-US/management-server-install-db-external.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-db-external.xml b/docs/en-US/management-server-install-db-external.xml
index bc76829..e77380f 100644
--- a/docs/en-US/management-server-install-db-external.xml
+++ b/docs/en-US/management-server-install-db-external.xml
@@ -22,71 +22,82 @@
  under the License.
 -->
 
-<section id="install-database-on-separate-node">
+<section id="management-server-install-db-external">
     <title>Install the Database on a Separate Node</title>
     <para>This section describes how to install MySQL on a standalone machine, separate from the Management Server.
         This technique is intended for a deployment that includes several Management Server nodes.
         If you have a single-node Management Server deployment, you will typically use the same node for MySQL.
-        See <xref linkend="install-database-on-management-server-node"/>.
+        See <xref linkend="management-server-install-db-local"/>.
     </para>
+    <note>
+        <para>The management server doesn't require a specific distribution for the MySQL node.
+            You can use a distribution or Operating System of your choice.
+            Using the same distribution as the management server is recommended, but not required.
+            See <xref linkend="management-server-system-requirements"/>.
+        </para>
+    </note>
     <orderedlist>
-        <listitem><para>If you already have a version of MySQL installed on the Management Server node, make one of the following choices, depending on what version of MySQL it is. The most recent version tested is 5.1.58.</para>
-            <itemizedlist>
-                <listitem><para>If you already have installed MySQL version 5.1.58 or later, skip to step 3.</para>
-                </listitem>
-                <listitem><para>If you have installed a version of MySQL earlier than 5.1.58, you can either skip to step 3 or uninstall MySQL and proceed to step 2 to install a more recent version.</para></listitem>
-            </itemizedlist>
-            <warning><para>It is important that you choose the right database version. Never downgrade a MySQL installation.</para></warning>
-        </listitem>
-        <listitem><para>Log in as root to your Database Node and run the following commands. If you are going to install a replica database, then log in to the master.</para>
-            <programlisting>
-# yum install mysql-server   
-# chkconfig --level 35 mysqld on
-            </programlisting>
+        <listitem>
+            <para>Install MySQL from the package repository from your distribution:</para>
+            <para condition="community">On RHEL or CentOS:</para>
+            <programlisting language="Bash">yum install mysql-server</programlisting>
+            <para condition="community">On Ubuntu:</para>
+            <programlisting language="Bash">apt-get install mysql-server</programlisting>
         </listitem>
         <listitem><para>Edit the MySQL configuration (/etc/my.cnf or /etc/mysql/my.cnf, depending on your OS) 
             and insert the following lines in the [mysqld] section. You can put these lines below the datadir 
             line. The max_connections parameter should be set to 350 multiplied by the number of Management 
             Servers you are deploying. This example assumes two Management Servers.</para>
+            <note>
+                <para>On Ubuntu you can also create a file /etc/mysql/conf.d/cloudstack.cnf and add these directives there. Don't forget to add [mysqld] on the first line of the file.</para>
+            </note>
             <programlisting>
 innodb_rollback_on_timeout=1
 innodb_lock_wait_timeout=600
 max_connections=700
 log-bin=mysql-bin
 binlog-format = 'ROW'
+bind-address = 0.0.0.0
             </programlisting>
-            <note><para>The binlog-format variable is supported in MySQL versions 5.1 and greater. It is not supported in MySQL 5.0. In some versions of MySQL, an underscore character is used in place of the hyphen in the variable name. For the exact syntax and spelling of each variable, consult the documentation for your version of MySQL.</para></note>
         </listitem>
-        <listitem><para>Restart the MySQL service, then invoke MySQL as the root user.</para>
-            <programlisting>
-# service mysqld restart
-# mysql -u root
-            </programlisting>
+        <listitem>
+            <para>On RHEL/CentOS MySQL doesn't start after installation, start it manually.</para>
+            <programlisting language="Bash">service mysqld start</programlisting>
         </listitem>
-        <listitem><para>Best Practice: On RHEL and CentOS, MySQL does not set a root password by default. It is very strongly recommended that you set a root password as a security precaution. Run the following commands, and substitute your own desired root password.</para>
-            <programlisting>mysql> SET PASSWORD = PASSWORD('password');</programlisting>
-            <para>From now on, start MySQL with mysql -p so it will prompt you for the password.</para>
+        <listitem>
+            <warning>
+                <para>On RHEL and CentOS, MySQL does not set a root password by default. It is very strongly recommended that you set a root password as a security precaution. Run the following commands, and substitute your own desired root password. This step is not required on Ubuntu as it asks for a root password during installation.</para>
+            </warning>
+            <para>Run this command to secure your installation. You can answer "Y" to all questions except to "Disallow root login remotely?". This is required to set up the databases.</para>
+            <programlisting>mysql_secure_installation</programlisting>
         </listitem>
-        <listitem><para>To grant access privileges to remote users, perform the following steps.</para>
+        <listitem><para>If a firewall is present on the system, open TCP port 3306 so external MySQL connections can be established.</para>
             <orderedlist numeration="loweralpha">
-                <listitem><para>Run the following commands from the mysql prompt:</para>
-                    <programlisting>
-mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; 
-mysql> exit
-                    </programlisting>
-                </listitem>
-                <listitem><para>Restart the MySQL service.</para>
-                    <programlisting># service mysqld restart</programlisting>
+                <listitem>
+                    <para>On RHEL/CentOS:</para>
+                    <orderedlist>
+                        <listitem>
+                            <para>Edit the /etc/sysconfig/iptables file and add the following line at the beginning of the INPUT chain.</para>
+                            <programlisting>-A INPUT -p tcp --dport 3306 -j ACCEPT</programlisting>
+                        </listitem>
+                        <listitem>
+                            <para>Now reload the iptables rules.</para>
+                            <programlisting language="Bash">service iptables restart</programlisting>
+                        </listitem>
+                    </orderedlist>
                 </listitem>
-                <listitem><para>Open the MySQL server port (3306) in the firewall to allow remote clients to connect.</para>
-                    <programlisting># iptables -I INPUT -p tcp --dport 3306 -j ACCEPT</programlisting>
-                </listitem>
-                <listitem><para>Edit the /etc/sysconfig/iptables file and add the following line at the beginning of the INPUT chain.</para>
-                    <programlisting> -A INPUT -p tcp --dport 3306 -j ACCEPT</programlisting>
+                <listitem>
+                    <para>On Ubuntu:</para>
+                    <para>UFW is the default firewall on Ubuntu, open the port with this command:</para>
+                    <programlisting language="Bash">ufw allow mysql</programlisting>
                 </listitem>
             </orderedlist>
         </listitem>
-        <listitem><para>Set up the database. The following command creates the cloud user on the database.</para>
+        <listitem>
+            <para>Set up the database. The following command creates the cloud user on the database.</para>
+            <note>
+                <para>This command should be run on the first Management server node!</para>
+            </note>
             <itemizedlist>
                 <listitem><para>In dbpassword, specify the password to be assigned to the cloud user. You can choose to provide no password.</para></listitem>
                 <listitem><para>In deploy-as, specify the username and password of the user deploying the database. In the following command, it is assumed the root user is deploying the database and creating the cloud user.</para></listitem>
@@ -94,12 +105,12 @@ mysql> exit
                 <listitem><para>(Optional) For management_server_key, substitute the default key that is used to encrypt confidential parameters in the &PRODUCT; properties file. Default: password. It is highly recommended that you replace this with a more secure value. See About Password and Key Encryption.</para></listitem>
                 <listitem><para>(Optional) For database_key, substitute the default key that is used to encrypt confidential parameters in the &PRODUCT; database. Default: password. It is highly recommended that you replace this with a more secure value. See About Password and Key Encryption.</para></listitem>
             </itemizedlist>
-            <programlisting># cloud-setup-databases cloud:&lt;dbpassword&gt;@localhost --deploy-as=root:&lt;password&gt; -e &lt;encryption_type&gt; -m &lt;management_server_key&gt; -k &lt;database_key&gt;</programlisting>
+            <programlisting language="Bash">cloud-setup-databases cloud:&lt;dbpassword&gt;@&lt;ip address mysql server&gt; \
+                --deploy-as=root:&lt;password&gt; \
+                -e &lt;encryption_type&gt; \
+                -m &lt;management_server_key&gt; \
+                -k &lt;database_key&gt;</programlisting>
             <para>When this script is finished, you should see a message like “Successfully initialized the database.”</para>
         </listitem>
-        <listitem><para>Now that the database is set up, you can finish configuring the OS for the Management Server. This command will set up iptables, sudoers, and start the Management Server.</para>
-            <programlisting># cloud-setup-management</programlisting>
-            <para>You should see the message “Management Server setup is done.”</para>
-        </listitem>
     </orderedlist>
 </section>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5c4cf118/docs/en-US/management-server-install-db-local.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-db-local.xml b/docs/en-US/management-server-install-db-local.xml
index 238f9de..ae8cfd1 100644
--- a/docs/en-US/management-server-install-db-local.xml
+++ b/docs/en-US/management-server-install-db-local.xml
@@ -22,28 +22,22 @@
  under the License.
 -->
 
-<section id="install-database-on-management-server-node">
+<section id="management-server-install-db-local">
     <title>Install the Database on the Management Server Node</title>
-    <para>This section describes how to install MySQL on the same machine with the Management Server. This technique is intended for a simple deployment that has a single Management Server node. If you have a multi-node Management Server deployment, you will typically use a separate node for MySQL. See <xref linkend="install-database-on-separate-node" />.
-    </para>
+    <para>This section describes how to install MySQL on the same machine with the Management Server. This technique is intended for a simple deployment that has a single Management Server node. If you have a multi-node Management Server deployment, you will typically use a separate node for MySQL. See <xref linkend="management-server-install-db-external" />.</para>
     <orderedlist>
-        <listitem><para>If you already have a version of MySQL installed on the Management Server node, make one of the following choices, depending on what version of MySQL it is. The most recent version tested is 5.1.58.</para>
-            <itemizedlist>
-                <listitem><para>If you already have installed MySQL version 5.1.58 or later, skip to step 4.</para>
-                </listitem>
-                <listitem><para>If you have installed a version of MySQL earlier than 5.1.58, you can either skip to step 4 or uninstall MySQL and proceed to step 2 to install a more recent version.</para></listitem>
-            </itemizedlist>
-            <warning><para>It is important that you choose the right database version. Never downgrade a MySQL installation.</para></warning>
-        </listitem>
-        <listitem><para>On the same computer where you installed the Management Server, re-run install.sh.</para>
-            <programlisting># ./install.sh</programlisting>
-            <para>You should see a few messages as the installer prepares, followed by a list of choices.</para>
-        </listitem>
-        <listitem><para>Choose D to install the MySQL server from the distribution’s repo.</para>
-            <programlisting>  > D</programlisting>
-            <para>Troubleshooting: If you do not see the D option, you already have MySQL installed. Please go back to step 1.</para>
+        <listitem>
+            <para>Install MySQL from the package repository from your distribution:</para>
+            <para condition="community">On RHEL or CentOS:</para>
+            <programlisting language="Bash">yum install mysql-server</programlisting>
+            <para condition="community">On Ubuntu:</para>
+            <programlisting language="Bash">apt-get install mysql-server</programlisting>
         </listitem>
-        <listitem><para>Edit the MySQL configuration (/etc/my.cnf or /etc/mysql/my.cnf, depending on your OS) and insert the following lines in the [mysqld] section. You can put these lines below the datadir line. The max_connections parameter should be set to 350 multiplied by the number of Management Servers you are deploying. This example assumes one Management Server.</para>
+        <listitem>
+            <para>Edit the MySQL configuration (/etc/my.cnf or /etc/mysql/my.cnf, depending on your OS) and insert the following lines in the [mysqld] section. You can put these lines below the datadir line. The max_connections parameter should be set to 350 multiplied by the number of Management Servers you are deploying. This example assumes one Management Server.</para>
+            <note>
+                <para>On Ubuntu you can also create a file /etc/mysql/conf.d/cloudstack.cnf and add these directives there. Don't forget to add [mysqld] on the first line of the file.</para>
+            </note>
             <programlisting>
 innodb_rollback_on_timeout=1
 innodb_lock_wait_timeout=600
@@ -51,48 +45,32 @@ max_connections=350
 log-bin=mysql-bin
 binlog-format = 'ROW'
             </programlisting>
-            <note><para>The binlog-format variable is supported in MySQL versions 5.1 and greater. It is not supported in MySQL 5.0. In some versions of MySQL, an underscore character is used in place of the hyphen in the variable name. For the exact syntax and spelling of each variable, consult the documentation for your version of MySQL.</para></note>
         </listitem>
-        <listitem><para>Restart the MySQL service, then invoke MySQL as the root user.</para>
-            <programlisting>
-# service mysqld restart
-# mysql -u root
-            </programlisting>
+        <listitem>
+            <para>On RHEL/CentOS MySQL doesn't start after installation, start it manually.</para>
+            <programlisting language="Bash">service mysqld start</programlisting>
         </listitem>
-        <listitem><para>Best Practice: On RHEL and CentOS, MySQL does not set a root password by default. It is very strongly recommended that you set a root password as a security precaution. Run the following commands, and substitute your own desired root password.</para>
-        <programlisting>mysql> SET PASSWORD = PASSWORD('password');</programlisting>
-            <para>From now on, start MySQL with mysql -p so it will prompt you for the password.</para>
+        <listitem>
+            <warning>
+                <para>On RHEL and CentOS, MySQL does not set a root password by default. It is very strongly recommended that you set a root password as a security precaution. Run the following commands, and substitute your own desired root password. This step is not required on Ubuntu as it asks for a root password during installation.</para>
+            </warning>
+            <para>Run this command to secure your installation. Since we are running MySQL locally you can answer "Y" to all questions.</para>
+            <programlisting>mysql_secure_installation</programlisting>
         </listitem>
-        <listitem><para>To grant access privileges to remote users, perform the following steps.</para>
-            <orderedlist numeration="loweralpha">
-                <listitem><para>Run the following commands from the mysql prompt:</para>
-                    <programlisting>
-mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; 
-mysql> exit
-                    </programlisting>
-                </listitem>
-                <listitem><para>Restart the MySQL service.</para>
-                    <programlisting># service mysqld restart</programlisting></listitem>
-                <listitem><para>Open the MySQL server port (3306) in the firewall to allow remote clients to connect.</para>
-                    <programlisting># iptables -I INPUT -p tcp --dport 3306 -j ACCEPT</programlisting></listitem>
-                <listitem><para>Edit the /etc/sysconfig/iptables file and add the following line at the beginning of the INPUT chain.</para>
-                    <programlisting> -A INPUT -p tcp --dport 3306 -j ACCEPT</programlisting></listitem>
-            </orderedlist>
-        </listitem>
-        <listitem><para>Set up the database. The following command creates the cloud user on the database.</para>
+        <listitem><para>Set up the database. The following command creates the "cloud" user on the database.</para>
             <itemizedlist>
-                <listitem><para>In dbpassword, specify the password to be assigned to the cloud user. You can choose to provide no password.</para></listitem>
-                <listitem><para>In deploy-as, specify the username and password of the user deploying the database. In the following command, it is assumed the root user is deploying the database and creating the cloud user.</para></listitem>
+                <listitem><para>In dbpassword, specify the password to be assigned to the "cloud" user. You can choose to provide no password although that is not recommended.</para></listitem>
+                <listitem><para>In deploy-as, specify the username and password of the user deploying the database. In the following command, it is assumed the root user is deploying the database and creating the "cloud" user.</para></listitem>
                 <listitem><para>(Optional) For encryption_type, use file or web to indicate the technique used to pass in the database encryption password. Default: file. See About Password and Key Encryption.</para></listitem>
                 <listitem><para>(Optional) For management_server_key, substitute the default key that is used to encrypt confidential parameters in the &PRODUCT; properties file. Default: password. It is highly recommended that you replace this with a more secure value. See About Password and Key Encryption.</para></listitem>
                 <listitem><para>(Optional) For database_key, substitute the default key that is used to encrypt confidential parameters in the &PRODUCT; database. Default: password. It is highly recommended that you replace this with a more secure value. See About Password and Key Encryption.</para></listitem>
             </itemizedlist>
-            <programlisting># cloud-setup-databases cloud:&lt;dbpassword&gt;@localhost --deploy-as=root:&lt;password&gt; -e &lt;encryption_type&gt; -m &lt;management_server_key&gt; -k &lt;database_key&gt;</programlisting>
+            <programlisting language="Bash">cloud-setup-databases cloud:&lt;dbpassword&gt;@localhost \
+                --deploy-as=root:&lt;password&gt; \
+                -e &lt;encryption_type&gt; \
+                -m &lt;management_server_key&gt; \
+                -k &lt;database_key&gt;</programlisting>
             <para>When this script is finished, you should see a message like “Successfully initialized the database.”</para>
         </listitem>
-        <listitem><para>Now that the database is set up, you can finish configuring the OS for the Management Server. This command will set up iptables, sudoers, and start the Management Server.</para>
-            <programlisting># cloud-setup-management</programlisting>
-            <para>You should see the message “Management Server setup is done.”</para>
-        </listitem>
     </orderedlist>
 </section>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5c4cf118/docs/en-US/management-server-install-db.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-db.xml b/docs/en-US/management-server-install-db.xml
new file mode 100644
index 0000000..24e638a
--- /dev/null
+++ b/docs/en-US/management-server-install-db.xml
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
+%BOOK_ENTITIES;
+]>
+
+<!-- Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<section id="management-server-install-db">
+    <title>Install the database server</title>
+    <para>The &PRODUCT; management server uses a MySQL database server to store it's data.
+        When you are installing the management server on a single node you can install the MySQL server locally.
+        When using a multi-node installation the MySQL database has to run on an external node.
+    </para>
+    <para>&PRODUCT; has been tested with MySQL 5.1 and 5.5, both should work fine. These versions are included in RHEL/CentOS and Ubuntu.</para>
+    <xi:include href="management-server-install-db-local.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="management-server-install-db-external.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</section>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5c4cf118/docs/en-US/management-server-install-flow.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-flow.xml b/docs/en-US/management-server-install-flow.xml
index 112771b..33bcac9 100644
--- a/docs/en-US/management-server-install-flow.xml
+++ b/docs/en-US/management-server-install-flow.xml
@@ -27,8 +27,7 @@
     <xi:include href="management-server-install-overview.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="management-server-install-prepare-os.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="management-server-install-client.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-db-local.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-    <xi:include href="management-server-install-db-external.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+    <xi:include href="management-server-install-db.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="management-server-install-nfs-shares.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="management-server-install-multi-node.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
     <xi:include href="management-server-install-systemvm.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5c4cf118/docs/en-US/management-server-install-multi-node.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/management-server-install-multi-node.xml b/docs/en-US/management-server-install-multi-node.xml
index 17d0f86..db4bca5 100644
--- a/docs/en-US/management-server-install-multi-node.xml
+++ b/docs/en-US/management-server-install-multi-node.xml
@@ -56,7 +56,7 @@
             </programlisting>
         </listitem>
         <listitem><para>Configure the database client. Note the absence of the --deploy-as argument in this case.
-            (For more details about the arguments to this command, see <xref linkend="install-database-on-separate-node"/>.)
+            (For more details about the arguments to this command, see <xref linkend="management-server-install-db-external"/>.)
         </para>
             <programlisting># cloud-setup-databases cloud:&lt;dbpassword&gt;@&lt;dbhost&gt; -e &lt;encryption_type&gt; -m &lt;management_server_key&gt; -k &lt;database_key&gt;
             </programlisting>