To install and run your TYPO3 application, you need to disable the zend_extension extension.
Go to the etc> php.ini file and comment out the following line:#zend_extension=/usr/lib64/php/modules/opcache.so
extension=memcached.so
session.save_handler = memcached session.save_path = "<server>:11211"
Instead,IP Memcached . , Memcached .
IP Memcached . , Memcached .
3. Save the changes and restart the Apache server.C. Database Setup
The next step is to configure MySQL database replication (master and slave) to protect the application from downtime or data loss.
MySQL in an environment with deployed TYPO3 will be used as the main database. For the subordinate base, you need to create a separate environment.
Go to the Jelastic control panel and create a new environment with a MySQL node that will be used as a subordinate database. Name your environments (for example, slave-db) and click Create .
And now let's configure each database separately:Master database
As mentioned above, we use MySQL in an environment with a deployed application (ie, typo-cluster ) as our main database.
1. Click the Configuration button for the main database.
2. Go to the my.cnf file in the etc folder and set the following parameters, as shown in the image below (you need to uncomment only two lines):
server-id = 1 log-bin = mysql-bin binlog-format=mixed
We use binlog-format = mixed to allow replication of operations with foreign keys.Do not use binlog_format = statement , otherwise there will be errors later!
3. Save the changes and Restart MySQL to apply the new configuration settings.
4. Click the Open in browser button near the main MySQL database. Log into the MySQL administration panel using the credentials you received via email after creating the environment.
5. Go to the Replication tab and click Add Replication Sub - User .
6. Enter the name and password for the replication subordinate user and click OK .
Your subordinate user has been successfully created.Slave Database
Now let's establish a connection between the master and slave MySQL databases.
1. Click the Configuration button for the subordinate database.
2. Open the file etc> my.cnf and add the following lines:
server-id = 2 slave-skip-errors = all
We allow our subordinate database to skip all errors of the main one ( slave-skip-errors = all ) in order not to interrupt the normal operation in case of their occurrence.
This is not recommended at the development stage to be able to find bugs, etc. However, in this instruction, we focus on the production stage when your code has already been tested. Any error on the side of the main base, even a minor one, can stop the subordinate or lead to out of sync.
3. Save the changes and Restart the slave database server to apply the new configuration settings.
4. Log in to phpMyAdmin using the account information that Jelastic sent you when creating the environment for the subordinate database.
5. Go to the Replication tab and click the setting in the Replication section of the slave server .
6. Configure the core server (enter the name, password, and host of the slave replication user).
Now the main server is configured.
7. Click on the Control slave> Full start for the slave server to start the Slave SQL and Slave IO streams.
8. Check the subordinate server status table to make sure everything is in order.
As a result, replication is configured and all data is synchronized between the main and subordinate databases.D. Installing TYPO3
Now we can complete the installation of TYPO3.
1. Go to the Jelastic control panel and click the Open in browser button for the TYPO3 environment. Installation will begin. Click Continue .
2. In the Connect to your database host window:
- select MySQL / MySQL driver
- fill in the Username and Password fields with credentials of your main database (received by email when creating the environment)
- in the Host field enter the address of the database server
Click Continue .
3. At the Select database stage, create a new database: enter a name for the TYPO3 database (for example, typo_db ) and click Continue .Thanks to the database replication we configured earlier, the created database will automatically appear on both MySQL servers, master and slave.
4. In the next window, select the Introduction package . Click Continue .
5. Installation will begin. Wait a few minutes to complete it.
6. Finally, enter the password to access the TYPO3 admin panel and select the color of the TYPO3 main page.
Congratulations! TYPO3 installed.E. Cluster Setup
After the TYPO3 installation has been successfully completed, we can proceed to setting up a highly available cluster.
1. Open the Jelastic control panel and click the Change Environment Topology button for the environment with the TYPO3 application.
2. Add another Apache application server by clicking the + button (highlighted in the image below). NGINX balancer will be added automatically. Click Apply .
- The reason that we add a second application server only after installation is that in this way we synchronize all the data between two Apache nodes and avoid reinstalling and configuring.
- You can also configure file synchronization between cluster servers using the instructions in the document File Synchronization
Your highly reliable and scalable clustered solution with TYPO3 installed is ready for use. Click Open in browser and get to work.
Using another TYPO3 clustering method? Please share your experience with us in the comments below.
Source: https://habr.com/ru/post/217213/
All Articles