#Install MySQL 8 in Rocky Linux
Explore tagged Tumblr posts
Text
How to Install MySQL 8 on CentOS 7 Linux
How to Install MySQL 8 on CentOS 7 Linux
Hi Friends! We will learn about “How to install MySQL 8 on CentOS 7 Linux”, we will look at the installation for MySQL 8 step by step in CentOS 7 . MySQL is the Relation Database, which is used to store the data. It Is open-source and widely used in the industries. MySQL written in C and C++. It has also been tested to be a “fast, stable and true multi-user, multi-threaded SQL database…
View On WordPress
#install mysql 8#install mysql 8 centos 7#install mysql 8 centos 7 digitalocean#install mysql 8 in centos 7#Install MySQL 8 in Rocky Linux#install mysql 8 on amazon linux#install mysql 8 on rhel 7#Install MySQL 8 on Ubuntu 20.04#Install mySQL in linux#install mysql on ubuntu 18.04#mysql community download#mysql community edition#mysql community server download
0 notes
Text
In today’s article we shall install MySQ... https://www.computingpost.com/install-mysql-5-7-on-rocky-linux-8almalinux-8/?feed_id=16322&_unique_id=6354f844cd1c0
0 notes
Text
How to Install MySQL 8.0 on Rocky Linux 9

MySQL is a SQL-based relational database management system (Structured Query Language). It is a popular database software for a variety of well-known applications. MySQL is used for data warehousing, e-commerce, and logging applications, but the most often utilized function is online database storage and administration. MySQL has been in use for almost 20 years and is widely regarded as one of the most secure and dependable database systems. Despite this, it has a number of disadvantages that should be addressed before adopting it for mission-critical applications. One disadvantage is that it does not handle transactions across several tables, which might result in a data inconsistency if the system fails. Furthermore, some of the more complex capabilities found in other database systems, such as stored procedures and triggers, are not supported by MySQL. MySQL is a fantastic solution for many applications, but it must be used with caution in a production context.
The database management system’s current edition, MySQL 8.0, includes new features and security fixes. This latest version of MySQL includes support for joins with bigger data sets, improved efficiency when importing huge files, and many changes to InnoDB, SQL mode, dubbed’strict sql mode,’ which will make MySQL more SQL-compliant. There are also speed improvements for DML statements and replication, as well as various additional security features. With these enhancements, MySQL 8.0 delivers a more robust and secure data management platform.
In this guide, you will learn how to install MySQL 8.0 on Rocky Linux 9 via the command line terminal, as well as how to secure, update, and, if required, deactivate the MySQL service.
https://www.markaicode.com/how-to-install-mysql-8-0-on-rocky-linux-9/
0 notes
Text
How to install Apache on Almalinux 8 / Rocky Linux 8 - Linux Shout
How to install Apache on Almalinux 8 / Rocky Linux 8 – Linux Shout
Apache is the most widely used and popular open-source web server on the Internet. It can be flexibly configured and expanded using a large number of modules. Here we learn how to install Apache webserver on AlmaLinux or Rocky Linux 8 using the command line.Most of the time we use Apache web server in combination with MySQL and PHP or Perl or Python to create a LAMP server ( Linux, Apache,…
View On WordPress
0 notes
Text
Red Hat Enterprise Linux 9 is the latest stable release version on RHEL. From its base, several other versions were developed such as Rocky Linux 9 and AlmaLinux 9. CentOS Stream 9, derived from Fedora 34 was used to develop RHEL 9. All these release version catty nifty features such as GNOME 40, improved security and identity, improved Cockpit Web Console e.t.c. The main task of a Linux system administrator is to monitor the Linux system hardware and software and perform installations and upgrades while maintaining all the essential services and applications. In many circumstances, Linux system administrators perform these activities via the command line. This is because the command line(server editions) is light and faster as compared to GUI editions. However, running commands on the command line requires one to memorize the commands for the tasks. For that reason, many organizations preferred Windows systems where things are managed from a point-and-click GUI. Luckily, in the past years, developers have developed independent GUI-based tools with abilities to manage some particular system areas and perform associated administrative tasks. Some of the tools developed are phpMyAdmin, Apache Directory, MySQL Workbench, Webmin, Ajenti, Shorewall, Cockpit, CUPS, cPanel, YaST e.t.c What is Cockpit? Cockpit(RHEL web console) is a GUI-web-based tool developed by RedHat with the main objective of making server administration easier. It is used to manage and monitor the local system as well as the remote system available on your network. When using Cockpit, similar APIs as those in the terminal are used, and the tasks performed on the command line are immediately reflected in the RHEL web console. There is a wide range of activities you can perform with Cockpit. Some of them are: Managing user accounts Configuring SELinux Setting kernel dump configuration Managing system subscriptions Updating software Reviewing system logs Creating diagnostic reports Configuring network interfaces and firewall Managing and monitoring system services Multiple server monitoring Storage administration In this guide, we will learn how to manage Rocky Linux 9 / AlmaLinux 9 using Cockpit Dashboard #1. Install Cockpit Dashboard on Rocky Linux 9 / AlmaLinux 9 By default, Cockpit is installed on Rocky Linux 9 / AlmaLinux 9. If not it can be installed easily by executing the command below. sudo dnf install cockpit Once the installation is complete, start and enable the cockpit.socket service. sudo systemctl enable --now cockpit.socket Verify if the service is running: $ systemctl status cockpit.socket ● cockpit.socket - Cockpit Web Service Socket Loaded: loaded (/usr/lib/systemd/system/cockpit.socket; enabled; vendor preset: disabled) Active: active (listening) since Fri 2022-09-09 11:11:20 CEST; 7s ago Until: Fri 2022-09-09 11:11:20 CEST; 7s ago Triggers: ● cockpit.service Docs: man:cockpit-ws(8) Listen: [::]:9090 (Stream) Process: 1874 ExecStartPost=/usr/share/cockpit/motd/update-motd localhost (code=exited, status=0/SUCCESS) Process: 1881 ExecStartPost=/bin/ln -snf active.motd /run/cockpit/motd (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 23441) Memory: 1.0M CPU: 14ms CGroup: /system.slice/cockpit.socket By default, the service listens to port 9090. So we need to allow the service through the firewall: sudo firewall-cmd --add-service=cockpit --permanent sudo firewall-cmd --reload #2. Configure Cockpit on Rocky Linux 9 / AlmaLinux 9 Once installed, you can configure Cockpit by editing or creating the /etc/cockpit/cockpit.conf file sudo vim /etc/cockpit/cockpit.conf In this file, you can enable automatic idle lock in the web console by adding the below lines: [Session] IdleTimeout=X Here, X is the period in minutes for the idle timeout. For example 10 minutes. To edit the listen port for Cockpit, begin by allowing the desired port through the firewall:
sudo semanage port -a -t websm_port_t -p tcp PORT_NUMBER Allow the port through the firewall: sudo firewall-cmd --permanent --service cockpit --add-port=PORT_NUMBER/tcp sudo firewall-cmd --reload Now change the port with the command: sudo systemctl edit cockpit.socket Make the desired configurations: [Socket] ListenStream=PORT_NUMBER ... Also, Cockpit loads certificates in the /etc/cockpit/ws-certs.d directory and uses the last file with the .cert in alphabetical order. You need to install a certificate signed by a certificate authority (CA) to avoid security exceptions. Once the settings have been made, restart the service: sudo systemctl daemon-reload sudo systemctl restart cockpit.socket #3. Logging in to the Cockpit web console Access the Cockpit web dashboard using any of the browsers below: Mozilla Firefox 52 and later Google Chrome 57 and later Microsoft Edge 16 and later Now access the dashboard with the URL https://IP_Address:9090 or https://domain_name:9090. If you are using a self-signed certificate, you will receive the warning below. This is a security warning that can be avoided by installing a trusted SSL certificate. To proceed, click on Advanced->Proceed and you will be granted the login page below. Log in using an account with sudo privileges. This is necessary since Cockpit uses the PAM stack authentication method found in /etc/pam.d/cockpit. This makes it possible to log in using any local account on the system. Once authenticated, you will be granted the Cockpit dashboard below. #4. Manage Rocky Linux 9 / AlmaLinux 9 using Cockpit You can now use Cockpit to manage your Rocky Linux 9 / AlmaLinux 9 system. There are several tasks you can perform. Some of these tasks are: 1. Restart/Shutdown the system To restart/shutdown your Rocky Linux 9 / AlmaLinux 9 from the Cockpit Dashboard, navigate to Overview-> Reboot/Shutdown You can set a delay for the reboot/shutdown or run the task immediately without any delay using the options in the drop-down menu. 2. Configuring the System Time It is also possible to set time synchronization using a Network Time Protocol (NTP). This can be achieved by navigating to Overview-> system time You can change the Timezone from the drop-down menu and set the time manually or automatically with NTP. 3. Configure Network and Firewall Configure your network and firewall by navigating to the networking tab on the left panel. While here, there are many configurations you can make such as adding networks(bridge, bond, VLAN, team) and configuring firewall rules. For example, adding a bridge, proceed as shown. 4. View System logs To view the logs on your system, navigate to the Logs tab as shown. To view details of the logs, click on the log displayed. 5. Manage system services System service can be managed from the Cockpit dashboard under the services tab. While on this tab, you can view the status of the services and manage them as desired. 6. Configure SELinux To manage SELinux, navigate to the SELinux tab where you can check the mode, and toggle between Permissive and enforcing modes. 7. Storage management Under storage management, you can see the available storage devices, the disk consumption, read and write speeds as well as the Filesystems. You can also configure NFS shares, iSCSI targets and view logs associated with storage disks. 8. Access the Terminal From the Cockpit dashboard, you can access the terminal and run commands on your system. To launch the terminal, click on Terminal as shown. #5. Install Cockpit add-ons on Rocky Linux 9 / AlmaLinux 9 To be able to use an add-on on Cockpit, you need to install it separately. There are several add-on packages for Cockpit. They include: cockpit-composer: Building custom OS images cockpit-machines: Managing libvirt virtual machines cockpit-packagekit: Software updates and application installation
cockpit-podman: Managing podman containers cockpit-session-recording: Recording and managing user sessions PCP: Persistent and more fine-grained performance data (installed on demand from the UI) A preferred add-on can be installed with the command: sudo dnf install For example cockpit-podman and cockpit-machines sudo dnf install cockpit-podman cockpit-machines Once installed, you can use the add-ons as shown 1. Manage Virtual Machines To manage the VMs on your Rocky Linux 9 / AlmaLinux 9 system, navigate to Virtual Machines as shown. But first, you need to enable libvirt sudo systemctl enable --now libvirtd Once you reload the page you will see the below page. You can now create a new VM by clicking on Create new VM. Provide the required resources for the VM and click create. Once created, the Virtual machine will be listed and can be managed with ease. 2. Manage Podman containers Using the installed cockpit-podman add-on, you can easily manage Podman containers from the Cockpit web. Click on Podman containers-> Start Podman You can also start the services from the terminal sudo systemctl enable --now podman podman.socket Once started, you can create and manage containers. Provide the container name and image. Once created, the container will be available as shown. Conclusion That marks the end of this guide on how to manage Rocky Linux 9 / AlmaLinux 9 using Cockpit Dashboard. We can all agree that the Cockpit Dashboard makes system administration easier. Proceed and enjoy the awesomeness of this tool.
0 notes
Text
Mattermost is an open-source messaging platform designed to serve a large number of concurrent users across the world. It is the biggest competitor of MS Teams and Slack. The connection between individuals can be through video calls, normal voice calls, or chats. Mattermost gains popularity over other messaging platforms due to the following key features: Supports third Party Integrations Drag & Drop features IT Service desk Offers file Sharing Alerts/Notifications Incident resolution – resolves incidents quicky and thus saving on time. Data Import and Export Supports document Storage Application and network performance monitoring. Workflow management and orchestration. To install and configure Mattermost on a Kubernetes Cluster, follow the steps below: Setup Requirements. Ensure that you have a Kubernetes cluster set up. However, you can achieve this using the dedicated guides below: Install Kubernetes Cluster on Rocky Linux 8 with Kubeadm & CRI-O Install Kubernetes Cluster on Ubuntu using K3s Deploy Kubernetes Cluster on Linux With k0s Run Kubernetes on Debian with Minikube You also need to have kubectl installed. curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" chmod +x kubectl sudo mv kubectl /usr/local/bin To be able to use Kubectl, you should be able to access the cluster using the generated certificate. # For k0s export KUBECONFIG=/var/lib/k0s/pki/admin.conf With the requirements met, proceed as below. 1 – Create the Mattermost Namespace We will first create the Mattemost namespace where our installation will happen. This namespace will contain several virtual clusters. Create the namespace. kubectl create namespace mattermost Verify if the namespace has been created: $ kubectl get namespaces NAME STATUS AGE default Active 97s kube-node-lease Active 97s kube-public Active 97s kube-system Active 97s mattermost Active 45s 2 – Create the Secrets File The secret file contains database details for the Mattermost database. Begin by generating base64 credentials as below. # MySQL root user $ echo -n 'root' | base64 cm9vdA== # MySQL root user password $ echo -n 'StrongRootPassword' | base64 U3Ryb25nUm9vdFBhc3N3b3Jk #Mattermost MySQL database name $ echo -n 'mattermost' | base64 bWF0dGVybW9zdA== # Mattermost MySQL user $ echo -n 'mattermost' | base64 bWF0dGVybW9zdA== # Mattermost MySQL user Password $ echo -n 'StrongUserPassword'|base64 U3Ryb25nVXNlclBhc3N3b3Jk Now create the secrets file vim secrets.yaml Add the lines below replacing appropriately apiVersion: v1 kind: Secret metadata: name: mattermost.env namespace: mattermost type: Opaque data: ROOT: cm9vdA== ROOT_PASSWORD: U3Ryb25nUm9vdFBhc3N3b3Jk DATABASE: bWF0dGVybW9zdA== USER: bWF0dGVybW9zdA== PASSWORD: U3Ryb25nVXNlclBhc3N3b3Jk Apply the config file. kubectl apply -f secrets.yaml Verify if the config has been applied. $ kubectl get secret -n mattermost NAME TYPE DATA AGE default-token-xlwqr kubernetes.io/service-account-token 3 84s mattermost.env Opaque 5 5s 3 – Create the Mattermost Database Pod. For this guide, we will use the MariaDB database. Create a volume for MariaDB sudo mkdir /var/mattermost Create a YAML file for the database vim database.yaml Add the below content to the file. --- apiVersion: v1 kind: Service metadata: name: mariadb namespace: mattermost spec: selector: app: mariadb ports: - name: mariadb protocol: TCP port: 3306 --- apiVersion: apps/v1 kind: Deployment metadata: name: mariadb namespace: mattermost labels: app: mariadb spec: selector: matchLabels: app: mariadb
template: metadata: labels: app: mariadb spec: containers: - name: mariadb image: mariadb:10.6 env: - name: MYSQL_ROOT_PASSWORD valueFrom: secretKeyRef: name: mattermost.env key: ROOT_PASSWORD - name: MYSQL_DATABASE valueFrom: secretKeyRef: name: mattermost.env key: DATABASE - name: MYSQL_USER valueFrom: secretKeyRef: name: mattermost.env key: USER - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: mattermost.env key: PASSWORD ports: - containerPort: 3306 name: mariadb volumeMounts: - name: mariadb-storage mountPath: /var/lib/mysql volumes: - name: mariadb-storage hostPath: path: /var/mattermost type: Directory Apply the configuration. kubectl apply -f database.yaml Verify if the pod has been created: $ kubectl get pod -n mattermost NAME READY STATUS RESTARTS AGE mariadb-5cdf7f54f4-9d7xb 1/1 Running 0 6m48s 4 – Deploy the Mattermost Service The Mattermost service will be used to expose our application running on port 8065. There are several ways to deploy a service such as NodePort, ClusterIP, or LoadBalancer Create the Mattermost service file: vim service.yaml Here, we will deploy a LoadBalancer service. apiVersion: v1 kind: Service metadata: name: "mattermost-service" namespace: mattermost spec: type: LoadBalancer ports: - name: http port: 8065 targetPort: 8065 protocol: TCP selector: app: mattermost-app Apply the config. kubectl apply -f service.yaml Verify if the service has been created: $ kubectl get svc -n mattermost NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE mariadb ClusterIP 10.100.76.56 3306/TCP 7m36s mattermost-service LoadBalancer 10.99.90.154 8065:30095/TCP 5s 5 – Deploy the Mattermost Application. Now deploy the application. Create the deployment YAML as below vim mattermost_app.yaml To the file, add the lines below: apiVersion: apps/v1 kind: Deployment metadata: name: mattermost-app labels: app: mattermost-app tier: app namespace: mattermost spec: selector: matchLabels: app: mattermost-app template: metadata: labels: app: mattermost-app spec: containers: - name: mattermost-app image: "mattermost/mattermost-team-edition:6.3.2" env: - name: DB_TYPE value: "mariadb" - name: DB_HOST value: "mariadb" - name: DB_PORT_NUMBER value: "3306" - name: MM_USERNAME valueFrom: secretKeyRef: name: mattermost.env key: USER - name: MM_PASSWORD valueFrom: secretKeyRef: name: mattermost.env key: PASSWORD - name: MM_DBNAME valueFrom: secretKeyRef: name: mattermost.env key: DATABASE - name: MM_SQLSETTINGS_DATASOURCE value: "mattermost:StrongUserPassword@tcp(mariadb:3306)/mattermost?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s" - name: MM_SQLSETTINGS_DRIVERNAME value: "mysql" ports: - containerPort: 8065 name: http volumeMounts: # optional persistent storage #- name: appdata #mountPath: /mattermost/data - name: etclocaltime mountPath: /etc/localtime readOnly: true volumes: # optional persistent storage #- name: appdata
#persistentVolumeClaim: # claimName: mattermost-app - name: etclocaltime hostPath: path: /etc/localtime Deploy the application: kubectl apply -f mattermost_app.yaml View if the deployment is successful. $ kubectl get deploy -n mattermost NAME READY UP-TO-DATE AVAILABLE AGE mariadb 1/1 1 1 12m mattermost-app 1/1 1 1 27s Get pods in the Mattermost namespace. $ kubectl get pods -nmattermost NAME READY STATUS RESTARTS AGE mariadb-5cdf7f54f4-9d7xb 1/1 Running 0 13m mattermost-app-795578f4bc-5862k 1/1 Running 0 83s Obtain the poet on which the Mattermost application has been exposed. $ kubectl get svc -n mattermost NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE mariadb ClusterIP 10.100.76.56 3306/TCP 14m mattermost-service LoadBalancer 10.99.90.154 8065:30095/TCP 6m46s 6 – Access the Mattermost Web Interface Now the Web UI should be accessible on port 30095. If you have a firewall enabled, allow the port through it. ##For Firewalld sudo firewall-cmd --add-service=30095/tcp --permanent sudo firewall-cmd --reload ##For UFW sudo ufw allow 30095 Now access the Mattermost Web Interface on your browser using the URL http://IP_Address:30095 or http://domain-name:30095 Create the Mattermost account and proceed to log in. Now you are set to manage your Mattermost installation. There are two options, create a team or proceed to the System console where you make admin changes to your server. The system console appears as below. To create a team and begin communication, proceed as below. Set the Team URL: Finish up the Team creation by providing the required details. Once created, you will have the team ready for communication as shown. Conclusion. That was enough learning! We have successfully walked through how to install and configure Mattermost on a Kubernetes Cluster. I hope this was impactful.
0 notes
Text
Normally, when the term Wiki is mentioned, the first thing that comes in the mind is wikipedia.org. There is a difference between the two, Wikipedia is just a website that adheres to the Wiki format while a wiki is defined as software built to help ease collaborative writing and editing for teams. It also offers a productive writing environment with a set of management tools for managers and moderators. Wiki has been in existence for a long time with popular wiki engines such as MediaWiki, PmWiki, TiddlyWiki, Wikkawiki, and DokuWiki. Amongst the many wiki engines, exists an open-source wiki engine with NodeJS technologies known as Wiki.js. This is a fully customizable wiki engine written in JavaScript. This open-source wiki engine is released under the Affero GNU General Public License. Wiki.js is an amazingly fast web application with support for many databases interface with primary support for PostgreSQL. Wiki.js is preferred due to the following amazing features: Full version and revision control. Fairly easy to use. Seamless Media Assets Management. Multi-lingual content support with full support for RTL languages like: Arabic, Hebrew and Persian. It has a search functionality as a built-in feature. Supports comments. Git-backed storage. It offers full support for content backup and synchronization for multi-vendors like Google Drive, AWS S3, Box.net,Dropbox, Microsoft OneDrive and DigitalOcean Spaces. Integrated access control. Assets management – media content can be inserted into content. By the end of this guide, you should be able to install and configure Wiki.js on Kubernetes Cluster. Getting Started For this guide, you will need a Kubernetes cluster set up. We have dedicated guides on how to set up a Kubernetes cluster. Deploy Kubernetes Cluster on Linux With k0s Install Kubernetes Cluster on Rocky Linux 8 with Kubeadm & CRI-O Install Kubernetes Cluster on Ubuntu using K3s Run Kubernetes on Debian with Minikube With your Kubernetes cluster set up, proceed as below. Install and Configure Wiki.js on Kubernetes Cluster Install and configure Wiki.js on Kubernetes Cluster on your system with the aid of the below steps. Step 1 – Create the Wiki.js Namespace Normally, a namespace is used to partition a single Kubernetes cluster into many virtual clusters. Begin by creating the namespace for wiki.js as below. kubectl create namespace wikijs Verify the namespace exists. $ kubectl get namespaces NAME STATUS AGE default Active 98s kube-node-lease Active 99s kube-public Active 99s kube-system Active 99s wikijs Active 11s Step 2 – Create the Secrets file The secret file contains the username and passwords to be created for the below database. Generate your own credentials for theROOT, ROOT_PASSWORD, DATABASE, USER variables. See below examples # MySQL root user $ echo -n 'root' | base64 cm9vdA== # MySQL root user password $ echo -n 'StrongRootPassword' | base64 U3Ryb25nUm9vdFBhc3N3b3Jk # Wiki.js MySQL database name $ echo -n 'wikijs' | base64 d2lraWpz # Wiki.js MySQL user $ echo -n 'wikijs' | base64 d2lraWpz # Wiki.js MySQL user Password $ echo -n 'WikijsUserPassw0rd' | base64 V2lraWpzVXNlclBhc3N3MHJk Now create a secret file as below. vim wikijs-secret.yaml In the file, add the below lines replacing appropriately. apiVersion: v1 kind: Secret metadata: name: mariadb-secret namespace: wikijs type: Opaque data: ROOT: cm9vdA== ROOT_PASSWORD: U3Ryb25nUm9vdFBhc3N3b3Jk DATABASE: d2lraWpz USER: d2lraWpz PASSWORD: V2lraWpzVXNlclBhc3N3MHJk Apply the made changes. kubectl apply -f wikijs-secret.yaml Verify if your change is made. $ kubectl get secret -n wikijs NAME TYPE DATA AGE default-token-pb9fx kubernetes.io/service-account-token 3 7m9s mariadb-secret Opaque 5 6s
Step 3 – Create the Database Pod for wiki.js This config file contains the database details for wiki.js. In this guide, we will use the MariaDB database which can be configured as below. Option 1: Using Persistent Volume with StorageClass (Recommended) For configuration of Kubernetes PV Storage solution refer to guides in the following links: Dynamic hostPath PV Creation in Kubernetes using Local Path Provisioner How To Deploy Rook Ceph Storage on Kubernetes Cluster Deploy and Use OpenEBS Container Storage on Kubernetes List available Storage Classes configured in your Kubernetes $ kubectl get storageclasses NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE rook-ceph-block rook-ceph.rbd.csi.ceph.com Delete Immediate true 211d rook-cephfs rook-ceph.cephfs.csi.ceph.com Delete Immediate true 211d Let’s create PV Claim for Wiki.js Database $ vim wikijs-pvc.yaml kind: PersistentVolumeClaim apiVersion: v1 metadata: name: wikijs-pv-claim namespace: wikijs spec: storageClassName: rook-cephfs accessModes: - ReadWriteOnce resources: requests: storage: 10Gi # Apply manifest $ kubectl apply -f wikijs-pvc.yaml Confirm PVC is created and available $ kubectl get pvc -n wikijs NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE wikijs-pv-claim Bound pvc-fdee5351-7a84-4823-9e6c-9cf9a6aabccc 10Gi RWO rook-cephfs 23s Create the wikijs-config.yaml file as below. vim wikijs-config.yaml Paste contents below into the file: --- apiVersion: v1 kind: Service metadata: name: mariadb namespace: wikijs spec: selector: app: mariadb ports: - name: mariadb protocol: TCP port: 3306 --- apiVersion: apps/v1 kind: Deployment metadata: name: mariadb namespace: wikijs labels: app: mariadb spec: selector: matchLabels: app: mariadb template: metadata: labels: app: mariadb spec: containers: - name: mariadb image: mariadb:latest env: - name: MYSQL_ROOT_PASSWORD valueFrom: secretKeyRef: name: mariadb-secret key: ROOT_PASSWORD - name: MYSQL_DATABASE valueFrom: secretKeyRef: name: mariadb-secret key: DATABASE - name: MYSQL_USER valueFrom: secretKeyRef: name: mariadb-secret key: USER - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: mariadb-secret key: PASSWORD - name: MARIADB_ROOT_HOST value: "%" ports: - containerPort: 3306 name: mysql volumeMounts: - name: wikijs-db mountPath: /var/lib/mysql volumes: - name: wikijs-db persistentVolumeClaim: claimName: wikijs-pv-claim Apply configuration file using the commands below $ kubectl apply -f wikijs-config.yaml -n wikijs service/mariadb created deployment.apps/mariadb created Confirm Pod is running: $ kubectl get deployment -n wikijs NAME READY UP-TO-DATE AVAILABLE AGE mariadb 1/1 1 1 5m20s $ kubectl get pods -n wikijs NAME READY STATUS RESTARTS AGE mariadb-75cc6d696-tw4ld 1/1 Running 0 5m27s Option 2: Using hostPath for data persistence (Note recommended) You will require to create a storage volume for MariaDB sudo mkdir /var/wikijs Create the wikijs-config.yaml file as below. vim wikijs-config.yaml In the file, add the below lines. Here do not alter anything. --- apiVersion: v1 kind: Service metadata: name: mariadb namespace: wikijs
spec: selector: app: mariadb ports: - name: mariadb protocol: TCP port: 3306 --- apiVersion: apps/v1 kind: Deployment metadata: name: mariadb namespace: wikijs labels: app: mariadb spec: selector: matchLabels: app: mariadb template: metadata: labels: app: mariadb spec: containers: - name: mariadb image: mariadb:latest env: - name: MYSQL_ROOT_PASSWORD valueFrom: secretKeyRef: name: mariadb-secret key: ROOT_PASSWORD - name: MYSQL_DATABASE valueFrom: secretKeyRef: name: mariadb-secret key: DATABASE - name: MYSQL_USER valueFrom: secretKeyRef: name: mariadb-secret key: USER - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: mariadb-secret key: PASSWORD - name: MARIADB_ROOT_HOST value: "%" ports: - containerPort: 3306 name: mysql volumeMounts: - name: mariadb-storage mountPath: /var/lib/mysql volumes: - name: mariadb-storage hostPath: path: /var/wikijs type: DirectoryOrCreate Remember under DB_TYPE, you can set the type of database you want to use i.e. Postgres, MySQL, MariaDB, MsSQL, SQLite e.t.c Apply the settings made. kubectl apply -f wikijs-config.yaml Verify if the MariaDB pod has been created. $ kubectl get pod -n wikijs NAME READY STATUS RESTARTS AGE mariadb-6f9ddfd55c-55rzq 1/1 Running 0 15s Step 4 – Deploy the Wiki.js Service and application Here, we can deploy the service as a NodePort, ClusterIP, or load balancer. First, create the file vim wikijs-service.yaml For Nodeport add the below lines. apiVersion: v1 kind: Service metadata: name: "wikijs" namespace: wikijs spec: type: NodePort ports: - name: http port: 3000 selector: app: "wikijs" For this guide, we will deploy the service as NodePort for the cluster to be accessed from outside. kubectl apply -f wikijs-service.yaml Verify this. $ kubectl get svc -n wikijs NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE mariadb ClusterIP 10.96.123.37 3306/TCP 29s wikijs NodePort 10.100.116.117 3000:31694/TCP 5s Printing Node Port value only $ kubectl get service wikijs -o jsonpath='.spec.ports[0].nodePort'; echo 31665 Now proceed to the wiki.js deployment. vim wikijs-deployment.yaml In the file, add the below lines, here don’t replace anything, we are simply mapping the above configs. apiVersion: apps/v1 kind: Deployment metadata: name: wikijs namespace: wikijs labels: app: wikijs spec: selector: matchLabels: app: wikijs template: metadata: labels: app: wikijs spec: containers: - name: wikijs image: requarks/wiki:latest imagePullPolicy: Always env: - name: DB_TYPE value: "mariadb" - name: DB_HOST value: "mariadb" - name: DB_PORT value: "3306" - name: DB_NAME valueFrom: secretKeyRef: name: mariadb-secret key: DATABASE - name: DB_USER valueFrom: secretKeyRef: name: mariadb-secret key: USER - name: DB_PASS valueFrom: secretKeyRef: name: mariadb-secret key: PASSWORD ports: - containerPort: 3000 name: http We have mapped the ConfigMap and secret variables to the deployment and also pulled the official wiki.js docker image. Now apply the made changes.
kubectl apply -f wikijs-deployment.yaml Get the deployment. $ kubectl get deploy -n wikijs NAME READY UP-TO-DATE AVAILABLE AGE mariadb 1/1 1 1 115s wikijs 1/1 1 1 14m Get the wiki.js pod. $ kubectl get pods -n wikijs NAME READY STATUS RESTARTS AGE mariadb-6f9ddfd55c-55rzq 1/1 Running 0 2m39s wikijs-548dcdd86c-tzp4f 1/1 Running 1 (5s ago) 93s As seen we have two pods running successfully. One for the database and the other for the wiki.js service. We can check logs to ensure Database connection is okay $ kubectl logs deploy/wikijs Loading configuration from /wiki/config.yml... OK 2022-05-17T16:41:59.475Z [MASTER] info: ======================================= 2022-05-17T16:41:59.479Z [MASTER] info: = Wiki.js 2.5.282 ===================== 2022-05-17T16:41:59.479Z [MASTER] info: ======================================= 2022-05-17T16:41:59.479Z [MASTER] info: Initializing... 2022-05-17T16:42:01.704Z [MASTER] info: Using database driver mysql2 for mariadb [ OK ] 2022-05-17T16:42:01.748Z [MASTER] info: Connecting to database... 2022-05-17T16:42:02.075Z [MASTER] info: Database Connection Successful [ OK ] Obtain the port to which the NodePort service has been exposed. $ kubectl get svc -n wikijs mariadb ClusterIP 10.96.123.37 3306/TCP 67s wikijs NodePort 10.104.156.51 3000:31694/TCP 22s Manually granting permissions on MySQL CLI In case of any database access issues like below: 2022-05-17T16:33:04.998Z [MASTER] error: Database Connection Error: ER_ACCESS_DENIED_ERROR undefined:undefined 2022-05-17T16:33:04.999Z [MASTER] warn: Will retry in 3 seconds... [Attempt 1 of 10] You can access MariaDB pod shell and grant permissions $ kubectl exec -ti deploy/mariadb -- bash root@mariadb-bc4b6f568-xsb92:/# mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 56 Server version: 10.6.7-MariaDB-1:10.6.7+maria~focal mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> Create user and grant permissions: CREATE USER 'wikijs'@'%' IDENTIFIED BY 'WikijsUserPassw0rd'; GRANT ALL PRIVILEGES ON *.* TO 'wikijs'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; EXIT; Validate user grants on the database: MariaDB [(none)]> SELECT host, user FROM mysql.user; +-------------------------+-------------+ | Host | User | +-------------------------+-------------+ | % | wikijs | | 127.0.0.1 | root | | ::1 | root | | localhost | mariadb.sys | | localhost | root | | mariadb-bc4b6f568-xsb92 | root | +-------------------------+-------------+ 7 rows in set (0.002 sec) MariaDB [(none)]> EXIT Bye Validate connectivity works root@mariadb-bc4b6f568-xsb92:/# mysql -u wikijs -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 31 Server version: 10.6.7-MariaDB-1:10.6.7+maria~focal mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | +--------------------+ 1 row in set (0.025 sec) MariaDB [(none)]> EXIT Bye Step 5 – Access the wiki.js Web UI. At this point, we can access the wiki.js service from the browser with the URL http://IP_Address:31694. Remember to replace the port with your own NodePort. You should be able to see this page: Fill in the required details for account creation and proceed with wiki.js installation.
When complete, you will be redirected to the login window. On successful login, you will see this wiki.js welcome notification. Proceed and create your wiki.js content. That was enough learning! I hope you too benefitted from this guide on how to install and Configure Wiki.js on Kubernetes Cluster.
0 notes
Text
Databases are considered one of the important services in a production environment. They are used to store and organize data. Depending on how data is stored and retrieved, databases can be categorized as: Relational databases (RDBMS or SQL databases): where data is stored in tables and rows, the tables are then linked using keys. They include MySQL, MariaDB, PostgreSQL, SQLite e.t.c Non-relational databases(NoSQL databases): here data is stored using a storage model optimized for specific requirements. They include Couchbase, Apache Cassandra, MongoDB, Redis, Apache HBase e.t.c MySQL is a popular open-source developed and distributed by the Oracle Corporation. It was founded in 1995 in Sweden and went open-source in 2000. In the year 2002, another MySQL headquarters was created in USA. In 2003, MyQSL entered a partnership with SAP and many features were added. In 2008, MySQL was acquired by Sun Microsystems. In 2009, Sun Microsystems was acquired by Oracle making MySQL an Oracle project. MariaDB is a free and open-source relational database fork of the MySQL database. It was developed by the original developers of the MySQL database after the Oracle Corporation intended to make MySQL and enterprise/paid version in 2010. MariaDB is known for its performance, stability, openness, and the MariaDB Foundation which accepts contributions on technical merit. The latest improvements are advanced clustering with Galera Cluster 4 and compatibility features with the Oracle Database. This guide will provide all the required steps on how to install and configure MariaDB / MySQL Database on Rocky Linux 9 / Alma Linux 9. #1. Install MariaDB / MySQL on Rocky Linux 9|AlmaLinux 9 Rocky Linux 9 and Alma Linux 9 released recently, provide MySQL 8 and MariaDB 10.5 in their default repositories. This makes it easy to install these latest release versions on your system. Install a preferred database on your system using the below steps: Option 1. Install MariaDB on Rocky Linux 9 / AlmaLinux 9 MariaDB 10.5 though not the latest release version of MariaDB can be installed easily by running the command: sudo dnf install mariadb-server mariadb Dependency Tree: Transaction Summary ================================================================================ Install 13 Packages Total download size: 18 M Installed size: 107 M Is this ok [y/N]: y Once installed, start and enable MariaDB the service: sudo systemctl enable --now mariadb Verify if the service is running: $ systemctl status mariadb ● mariadb.service - MariaDB 10.5 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2022-07-23 10:05:47 CEST; 2s ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 18153 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) Process: 18175 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS) Process: 20589 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS) Main PID: 20448 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 12 (limit: 23441) Memory: 78.5M CPU: 268ms CGroup: /system.slice/mariadb.service └─20448 /usr/libexec/mariadbd --basedir=/usr Option 2. Install MySQL Database on Rocky Linux 9 / AlmaLinux 9 MySQL 8.0 released on May 11, 2021, offers a lot of amazing features that include: Transactional data dictionary. Common Table Expressions. Windows Functions. InnoDB & XML enhancements. Error log improvements such as error numbering & reduced verbosity. Improved support for Native JSON data and document store functionality. This version is provided in the default Rocky Linux 9 / AlmaLinux 9 repositories. It can be installed by issuing the command: sudo dnf install mysql-server
Dependency Tree: Transaction Summary ================================================================================ Install 8 Packages Total download size: 20 M Installed size: 176 M Is this ok [y/N]: y Once installed, start and enable the MySQL service: sudo systemctl start mysqld sudo systemctl enable mysqld Check if the service is running on your system. $ systemctl status mysqld ● mysqld.service - MySQL 8.0 database server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2022-07-23 10:08:59 CEST; 8s ago Main PID: 31834 (mysqld) Status: "Server is operational" Tasks: 38 (limit: 23441) Memory: 460.9M CPU: 2.865s CGroup: /system.slice/mysqld.service └─31834 /usr/libexec/mysqld --basedir=/usr #2. Using MariaDB / MySQL on Rocky Linux 9|AlmaLinux 9 Once installed MariaDB/MySQL databases can be used. First, secure the installation by setting a password for the root user. sudo mysql_secure_installation Proceed as shown: On MySQL ..... Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No: Y .... There are three levels of password validation policy: LOW Length >= 8 MEDIUM Length >= 8, numeric, mixed case, and special characters STRONG Length >= 8, numeric, mixed case, special characters and dictionary file Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2 .... Please set the password for root here. New password: Re-enter new password: Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y ...... On MariaDB: NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): Press_Enter OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] y You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] y New password: Re-enter new password: Password updated successfully! ..... Remove anonymous users? [Y/n] y .... Disallow root login remotely? [Y/n] y ... Remove test database and access to it? [Y/n] y .... Reload privilege tables now? [Y/n] y All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! Now login using the created root password: $ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 8.0.28 Source distribution Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> Check the version using the command: mysql> SELECT VERSION(); Sample Output: Create a User and Database: To create a user and database in MariaDB/MySQL, use the commands below replacing where required: CREATE DATABASE sampledb; CREATE USER 'test_user'@'%' IDENTIFIED BY 'Passw0rd';
GRANT ALL ON sampledb.* TO 'test_user'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; After this, you will have a database named sampledb and a user test_user who can be accessed remotely created as swell. Check the available databases: mysql> SHOW databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sampledb | | sys | +--------------------+ 5 rows in set (0.00 sec) mysql> View users: mysql> SELECT User, Host FROM mysql.user; +------------------+-----------+ | User | Host | +------------------+-----------+ | test_user | % | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +------------------+-----------+ 5 rows in set (0.00 sec) mysql> To delete a user, use the command with the below syntax: DROP USER 'username'@'host'; Create Tables We can then create and insert data into a table. For example in the created table above: USE sampledb; CREATE TABLE playground ( equip_id serial PRIMARY KEY, type varchar (50) NOT NULL, color varchar (25) NOT NULL, location varchar(25) check (location in ('north', 'south', 'west', 'east', 'northeast', 'southeast', 'southwest', 'northwest')), install_date date ); Insert the data into the preferred table: INSERT INTO playground (type, color, location, install_date) VALUES ('slide', 'blue', 'south', '2017-04-28'); INSERT INTO playground (type, color, location, install_date) VALUES ('swing', 'yellow', 'northwest', '2018-08-16'); View the added data: mysql> SELECT * FROM playground; +----------+-------+--------+-----------+--------------+ | equip_id | type | color | location | install_date | +----------+-------+--------+-----------+--------------+ | 1 | slide | blue | south | 2017-04-28 | | 2 | swing | yellow | northwest | 2018-08-16 | +----------+-------+--------+-----------+--------------+ 2 rows in set (0.00 sec) mysql> exit #3. Configure MariaDB / MySQL Database Once installed, you can customize your MariaDB / MySQL Database as preferred. There are several configurations you can make by editing the configuration file stored at /etc/my.cnf.d/*. First stop the service: ##MariaDB sudo systemctl stop mariadb ##MySQL sudo systemctl stop mysqld Now proceed and make the desired configurations by editing files below: ##For MySQL sudo vim /etc/my.cnf.d/mysql-server.cnf ##For MariaDB sudo vim /etc/my.cnf.d/mariadb-server.cnf Changing the MySQL/MariaDB Listening Address By default, both MySQL and MariaDB listen on localhost, but if you want to access the database remotely, you need to allow it to listen to all IP addresses by adding/uncommenting the line: [mysqld] bind-address=0.0.0.0 Change the MySQL/MariaDB data directory By default, MariaDB and MySQL store data at /var/lib/mysql/. You can configure the database to store its data in a custom path. For example at /mnt/datastore sudo mkdir /mnt/datastore sudo chmod -R 777 /mnt/datastore/ sudo chown -R mysql:mysql /mnt/datastore With the custom path created, you need to copy the files in the old directory to the new path using the command: sudo dnf install rsync -y sudo rsync -av /var/lib/mysql/* /mnt/datastore For the path to be accessible, configure SELinux as shown: sudo semanage fcontext -a -t mysqld_db_t '/mnt/datastore(/.*)?' sudo restorecon -Rv /mnt/datastore Now open the configuration file and add the data directory as shown: For MySQL [mysqld] datadir= /mnt/mysql socket= /mnt/mysql/mysql.sock mysqlx_socket= /mnt/mysql/mysqlx.sock [client] socket= /mnt/mysql/mysql.sock For MariaDB you need to edit two files to accommodate the data directory: sudo vim /etc/my.cnf.d/mariadb-server.cnf Make the below changes to the file: [mysqld] datadir= /mnt/mysql socket= /mnt/mysql/mysql.sock
mysqlx_socket= /mnt/mysql/mysqlx.sock Save the file and also edit the below file for the clients on MariaDB. sudo vim /etc/my.cnf.d/client.cnf Add the custom port and socket: [client] socket= /mnt/mysql/mysql.sock # This group is not read by mysql client library, # If you use the same .cnf file for MySQL and MariaDB, # use it for MariaDB-only client options [client-mariadb] socket= /mnt/mysql/mysql.sock Configure a Custom Port The default port used by MySQL/MariaDB is 3306. However, you can configure the database to use another port. For example 4545 Open the configuration file and make these settings for the server and client connections. For MySQL [mysqld] port=4545 [client] port=4545 For MariaDB, you need to edit two files: $ sudo vim /etc/my.cnf.d/mariadb-server.cnf [mysqld] port=4545 Edit the client port. $ sudo vim /etc/my.cnf.d/client.cnf [client] port=4545 [client-mariadb] port=4545 Configure SELinux for the custom port: sudo semanage port -a -t mysqld_port_t -p tcp 4545 Restart the Services After the changes have been made, start the MySQL/MariaDB service: ##MariaDB sudo systemctl start mariadb ##MySQL sudo systemctl start mysqld Verify the changes made: $ sudo ss -plunt|grep 4545 tcp LISTEN 0 151 0.0.0.0:4545 0.0.0.0:* users:(("mysqld",pid=33606,fd=24)) Allow the set port through the firewall: sudo firewall-cmd --add-port=/tcp --permanent sudo firewall-cmd --reload Remember to replace the port appropriately. Access MySQL/MariaDB Remotely Once the listen address and port have been configured, you can access the database remotely from a MySQL client. For example, we will try accessing the database using the created user from the remote host: mysql -h -u -p -P For example, using the default MySQL port to 3306, the command will be: mysql -h 192.168.205.13 -u test_user -p -P 3306 Sample Output: After configuring a custom port, we will have the command as shown. MariaDB/MySQL Performance Tuning and Optimization When dealing with a large environment, the MariaDB / MySQL Database can have performance problems. To improve database performances, you may be required to tune the options. SQL performance tuning can be defined as the process of maximizing query speeds on a relational database. Before that, you need to evaluate a few resources: Storage: if you are using a traditional hard disk, it is recommended that you upgrade to a solid-state drive (SSD) for improved performance. You can use tools like iotop or sar from the sysstatpackage to check the disk input/output rates Processor: The top command can be used to measure how fast your system is. You may be required to check the MySQL processes and the percentage processor use. Memory: it is possible to improve the memory cache of MySQL to improve performance. This however requires you to have enough memory on your system Network: The network can also play part in low performances. You need to ensure that the network is sufficient to manage the load. The SQL performance tuning might involve several techniques such as: Writing more efficient database queries Structuring the database to retrieve data more efficiently. Tweaking the MySQL configuration files. Tweaking MySQL configuration files involves editing the /etc/mysql/my.cnf.d/* files. There are several configs defined here: query_cache_size: this is the size of the cache of MySQL queries waiting to run. It is recommended that the values be small, around 100-200MB max_connection: the number of connections allowed into the database innodb_buffer_pool_size: this config is used to allocate system memory as a data cache for your database innodb_io_capacity: It is used to set the rate for input/output from your storage device. This directly relates to the type and speed of your storage drive. max_heap_table_size: is the limit on an ENGINE=MEMORY table you create
LEAST(max_heap_table_size, tmp_table_size): is the cap on how big to let certain implicit temp tables to get These values can be defined as desired. For example: [mysqld] tmp_table_size=64M max_heap_table_size=64M After making the changes, restart the service: ##MariaDB sudo systemctl restart mariadb ##MySQL sudo systemctl restart mysqld That is it! We have successfully installed and configured MariaDB / MySQL Database on Rocky Linux 9 / Alma Linux 9. I hope this was informative.
0 notes
Text
MariaDB is a commonly used OpenSource database mainly known for being robust and scalable with new storage engines. MariaDB is a development of MySQL which puts focus on stability and performance and to make it free to users. It is the default database in most Linux distribution. With a variety of tools and plugins, MariaDB is widely applicable. In this guide, we are going to look at how to install MariaDB 10.6 on CentOS 7 | CentOS 8 Features of MariaDB 10.6 MariaDB 10.6 is the current stable version of MariaDB and comes with a number of new features as discussed below: Ignored Indexes – These are indexes that are visible and maintained but not used by the optimizer sys schema supported- This is a “system” database containing views and procedures for investigating performance problems. SKIP LOCKED – Locked tables are skipped from being updated or selected. JSON_TABLE() – can create a JSON table that can be used as a subquery from a JSON document. OFFSET…FETCH…[WITH TIES] – WITH TIES is an optional clause that adds extra functionality. Example as used Oracle compatibility – There are ongoing works in making MariaDB compatible with OracleDB with some Oracle Syntaxes and functions already added. The Improvements in MariaDB 10.6 from MariaDB 10.5 include: Atomic DDL – CREATE, ALTER, DROP and RENAME are atomic and crash safe. If MariaDB server crashes while processing any of these operations, the change will either e done completely or not done at all. InnoDB improvements – First insert to an empty table is faster. Also writes to temporary tables are avoided.Faster implicit and explicit temporary tables. Improvements in Galera. Ability to enable encrypted connections between two nodes without downtime. Also added flags to specify if galera controversial compatible features should be enabled. Clean up to remove unsupported features such as TukoDB Engine, Cassandra Engine, some InnoDB variables and some innodb_checksum_algorithm. Step 1: Update System Packages Ensure that you are running the latest system packages before installation to avoid possible inconveniences with dependencies. sudo dnf upgrade Step 2: Add MariaDB Repository We need to create a MariaDB repo file and add the content for MariaDB installation curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup sudo bash mariadb_repo_setup --mariadb-server-version=10.6 Command execution output: [info] Checking for script prerequisites. [info] Repository file successfully written to /etc/yum.repos.d/mariadb.repo [info] Adding trusted package signing keys... /etc/pki/rpm-gpg /home/rocky /home/rocky [info] Successfully added trusted package signing keys [info] Cleaning package cache... 62 files removed Step 3: Install MariaDB 10.6 on CentOS 8 | CentOS 7 Once you have saved the repo file, proceed to install MariaDB 10.6 sudo dnf install MariaDB-server MariaDB-client Step 4: Start and Enable MariaDB Once installed, start mariadb and also enable it to start automatically on system reboot. sudo systemctl start mariadb sudo systemctl enable mariadb Secure database server installation: $ sudo mariadb-secure-installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] y Enabled successfully! Reloading privilege tables.. ... Success! You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! Step 5: Check MariaDB Version We need to first login to MariaDB to be able to check the installed version. $ mysql -u root -p Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 10.6.4-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> You can already see the installed MariaDB version from the output above. However, you can also run the below command to check MariaDB version MariaDB [(none)]> SELECT VERSION(); +-------------------------------------+ | VERSION() | +-------------------------------------+ | 10.6.4-MariaDB | +-------------------------------------+ 1 row in set (0.000 sec) MariaDB [(none)]> Step 6: How to Create a Database in MariaDB Once you login to Mariadb, create a database as below: #Create a new database MariaDB [(none)]> CREATE DATABASE db1; Query OK, 1 row affected (0.000 sec) #If the database with the same name exists, you should get an error ERROR 1007 (HY000): Can't create database 'db1'; database exists #Create a database if already exits, replace MariaDB [(none)]> CREATE OR REPLACE DATABASE db1; Query OK, 2 rows affected (0.009 sec) #First check if a database exists MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS db1; Query OK, 1 row affected, 1 warning (0.000 sec) # Check Databases MariaDB MariaDB [(none)]> SHOW DATABASES; Step 7: How to Create User and Grant Privileges in Mariadb To create a user and grant privileges to the databases, run the commands as shown: #Create user mariadb MariaDB [(none)]> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; #Grant all privileges to the user MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'localhost' IDENTIFIED BY 'mypassword'; #Grant privileges to a specific database MariaDB [(none)]> GRANT ALL PRIVILEGES ON 'DB1'.* TO 'user1'@'localhost'; #Remember to refresh the privileges MariaDB [(none)]> FLUSH privileges; #To check user grants in MariaDB MariaDB [(none)]> SHOW GRANTS FOR 'myuser'@'localhost'; Step 8: Creating a Table and Adding Data in MariaDB Since we already have a database, we can proceed to create a table and add some values. MariaDB [(none)]> USE db1; MariaDB [(none)]> CREATE TABLE employees (id INT, name VARCHAR(20), email VARCHAR(20)); MariaDB [(none)]> INSERT INTO employees (id,name,email) VALUES(01,"lorna","[email protected]") Cleaning Up MariaDB To completely remove MariaDB, run the following commands:
sudo dnf remove MariaDB-server MariaDB-client sudo rm -rf /var/lib/mysql/ sudo rm /etc/my.cnf You have successfully installed the latest MariaDB version, MariaDB 10.6. We have also seen how you can clean up your MariaDB installation. I hope the guide has been helpful.
0 notes
Text
Building a secure, highly available multi-master, fault-tolerant MySQL environment has been challenging in the past due to the complex steps involved. Percona makes it easy to build a secure multi-master MySQL cluster with its own packaged distribution. Percona Server is a packaged MySQL server with high availability performance enhancements while Percona XtraDB is the High availability solution for the MySQL cluster. In this guide, we shall cover how to install and configure the Percona XtraDB Cluster on Rocky Linux 8. This fully packaged MySQL distribution provides simple steps which are very easy to configure. Our setup involves three nodes running Percona Server in active mode. This means that the three nodes will all be masters with Read/Write enabled on them. In our environment, we shall use three Rocky Linux 8 nodes with the details below: NODE IP Address HOSTNAME Node1 192.168.100.20 percona01 Node2 192.168.100.21 percona02 Node3 192.168.100.22 percona03 The steps below highlight the steps required to install and setup your highly available database cluster using Percona XtraDB. Setup static hostnames for the nodes Configure firewall Install Percona XtraDB cluster on all nodes Configure the Percona XtraDB nodes Test Replication within the cluster. Step 1: Setup Static Hostnames We need to setup the static hostnames for the nodes for hostname resolution. On each node, edit the /etc/hosts file and add the details of your node as shown in the example below: $ sudo vim /etc/hosts 192.168.100.20 percona01 192.168.100.21 percona02 192.168.100.22 percona03 Step 2: Configure Firewall on Rocky Linux 8 Nodes We need to configure the firewall to allow ports used for the PXC setup. This should be done on all the nodes. sudo firewall-cmd --add-port=3306/tcp,4444/tcp,4567/tcp,4568/tcp --zone=public --permanent sudo firewall-cmd --reload Step 3: Install Percona XtraDB Cluster on Rocky Linux 8 Next, we need to install PXC on the three nodes. The steps below will guide us on how to install PXC on Rocky Linux. 1. Configure percona repositories Configure the Percona repositories for Rocky Linux 8 so we can download the latest version of PXC. sudo yum -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm Enable Percona repositories: sudo percona-release enable-only pxc-80 release sudo percona-release enable tools release sudo yum repolist 2. Install Percona XtraDB Cluster Install PXC on the three Rocky Linux nodes. sudo yum -y module disable mysql sudo yum install percona-xtradb-cluster 3. Start Percona XtraDB Cluster Server Start the MySQL service for PXC. sudo service mysql start 4. Configure the root password for PXC We need to obtain the temporary password for the mysql superuser in the logs after the installation. We will then need to alter the password from the mysql console. sudo grep 'temporary password' /var/log/mysqld.log Use the password obtained to login to the database servers for each of the three nodes. $ mysql -u root -p Change the password to a strong password of your choice. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Str0nGP@ssw0rd'; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye 5. Stop MySQL Service Stop MySQL service on the three nodes to allow us to configure the cluster. sudo service mysql stop Step 4: Configuring Percona XtraDB Cluster on Rocky Linux 8 The next step will be to configure PXC on the three nodes. We will need to do one node at a time. Follow the guide below: 1. Configure the First node On the first node, modify and add the following information in the /etc/my.cnf file under the [mysqld] section. $ sudo vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql user=mysql # Path to Galera library wsrep_provider=/usr/lib64/galera4/libgalera_smm.so # Cluster connection URL contains the IPs of node#1, node#2 and node#3 wsrep_cluster_address=gcomm://192.168.100.20,192.168.100.21,192.168.100.22
# In order for Galera to work correctly binlog format should be ROW binlog_format=ROW # Using the MyISAM storage engine is not recommended. default_storage_engine=InnoDB # This InnoDB autoincrement locking mode is a requirement for Galera innodb_autoinc_lock_mode=2 # Node 1 address wsrep_node_address=192.168.100.20 # SST method wsrep_sst_method=xtrabackup-v2 # Cluster name wsrep_cluster_name=c4geeks_cluster In the above, edit the following lines and put the correct information according to your cluster. wsrep_cluster_address=gcomm:// wsrep_node_address= wsrep_cluster_name= Bootstrap the cluster from the first node as below: [root@percona01 ~]# systemctl start [email protected] Login to the MySQL server from the first node and check the status of the cluster. $ mysql -u root -p Enter Password: mysql> mysql> show status like 'wsrep%'; +----------------------------+--------------------------------------+ | Variable_name | Value | +----------------------------+--------------------------------------+ | wsrep_local_state_uuid | aead1f81-ec9e-11eb-8dbe-ffa1e1724fd3 | ... | wsrep_local_state | 4 | | wsrep_local_state_comment | Synced | ... | wsrep_cluster_size | 1 | | wsrep_cluster_status | Primary | | wsrep_connected | ON | ... | wsrep_ready | ON | +----------------------------+--------------------------------------+ 75 rows in set (0.00 sec) The above command shows that our cluster has been successfully bootstrapped. We now need to add the second and third nodes to the cluster. 2. Configure the Second Node Edit and make the following configuration to the /etc/my.cnf file under the [mysqld] section. $ sudo vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql user=mysql # Path to Galera library wsrep_provider=/usr/lib64/galera4/libgalera_smm.so # Cluster connection URL contains the IPs of node#1, node#2 and node#3 wsrep_cluster_address=gcomm://192.168.100.20,192.168.100.21,192.168.100.22 # In order for Galera to work correctly binlog format should be ROW binlog_format=ROW # Using the MyISAM storage engine is not recommended. default_storage_engine=InnoDB # This InnoDB autoincrement locking mode is a requirement for Galera innodb_autoinc_lock_mode=2 # Node 2 address wsrep_node_address=192.168.100.21 # SST method wsrep_sst_method=xtrabackup-v2 # Cluster name wsrep_cluster_name=c4geeks_cluster Make sure you use the correct details for the highlighted sections below: wsrep_cluster_address=gcomm:// wsrep_node_address= wsrep_cluster_name= Start mysql service on the second node. [root@percona02 ~]# systemctl start mysql Check the cluster status from any of the two nodes to see if the second node has successfully joined the cluster. mysql> show status like 'wsrep%'; +----------------------------+--------------------------------------+ | Variable_name | Value | +----------------------------+--------------------------------------+ | wsrep_local_state_uuid | aead1f81-ec9e-11eb-8dbe-ffa1e1724fd3 | ... | wsrep_local_state | 4 | | wsrep_local_state_comment | Synced | ... | wsrep_cluster_size | 2 | | wsrep_cluster_status | Primary | | wsrep_connected | ON | ... | wsrep_ready | ON | +----------------------------+--------------------------------------+ 40 rows in set (0.01 sec) The above output shows that the node has successfully joined the cluster since the value of wsrep_cluster_size has changed from 1 to 2.
3. Configure the Third Node To add the third node to the cluster, edit the /etc/my.cnf file and make the changes below. $ sudo vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql user=mysql # Path to Galera library wsrep_provider=/usr/lib64/galera4/libgalera_smm.so # Cluster connection URL contains the IPs of node#1, node#2 and node#3 wsrep_cluster_address=gcomm://192.168.100.20,192.168.100.21,192.168.100.22 # In order for Galera to work correctly binlog format should be ROW binlog_format=ROW # Using the MyISAM storage engine is not recommended. default_storage_engine=InnoDB # This InnoDB autoincrement locking mode is a requirement for Galera innodb_autoinc_lock_mode=2 # Node 2 address wsrep_node_address=192.168.100.22 # SST method wsrep_sst_method=xtrabackup-v2 # Cluster name wsrep_cluster_name=c4geeks_cluster Take note of the below sections and add the correct information. wsrep_cluster_address=gcomm:// wsrep_node_address= wsrep_cluster_name= Start mysql service on the third node. [root@percona03 ~]# systemctl start mysql When the server starts on the third node, check the cluster status to ascertain if the third node has successfully joined the cluster. mysql> show status like 'wsrep%'; +----------------------------+--------------------------------------+ | Variable_name | Value | +----------------------------+--------------------------------------+ | wsrep_local_state_uuid | aead1f81-ec9e-11eb-8dbe-ffa1e1724fd3 | ... | wsrep_local_state | 4 | | wsrep_local_state_comment | Synced | ... | wsrep_cluster_size | 3 | | wsrep_cluster_status | Primary | | wsrep_connected | ON | ... | wsrep_ready | ON | +----------------------------+--------------------------------------+ 40 rows in set (0.01 sec) We can see the node joined successfully in the above output. Step 5: Testing Replication on Percona XtraDB Cluster The next step is to confirm if replication is really working within the cluster. We will do a distributed modification of a database within the cluster and see if we get the correct output. Create a database from the third node: mysql@percona03> CREATE DATABASE percona_testdb; Query OK, 1 row affected (0.01 sec) Create a table to the database created from the second node: mysql@percona02> USE percona_testdb; Database changed mysql@percona3> CREATE TABLE test_table (instance_id INT PRIMARY KEY, instance_name VARCHAR(30)); Query OK, 0 rows affected (0.05 sec) Add some values to the table using the first node. mysql@percona01> INSERT INTO percona_testdb.test_table VALUES (3, 'percona03'); Query OK, 1 row affected (0.02 sec) From the third node, check if you can retrieve the values of the table we created above: mysql@percona03> SELECT * FROM percona_testdb.test_table; +---------+-----------+ | node_id | node_name | +---------+-----------+ | 3 | percona03 | +---------+-----------+ 1 row in set (0.00 sec) Wrap Up We have demonstrated how to setup a scalable, highly available, and secure MySQL cluster using Percona XtraDB Cluster (PXC). Feel free to try this solution out as it uses MySQL as the database engine but is fine-tuned for easy configuration and clustering. Feel free to reach out in case you encounter any issues setting up this environment. Cheers!
0 notes
Text
Not everyone will enjoy management of a database server from the command line interface. As a developer you need a faster way to move from development to Production, with less hassle and sometimes command line interfaces is not an option. One of the mostly used tools for database management – creating databases, users, starting and stopping services, importing and exporting databases is MySQL Workbench. In this short tutorial I’ll show you the steps you need to follow to install and start using MySQL Workbench on CentOS 8|Rocky Linux 8|AlmaLinux 8 Workstation. MySQL Workbench is a graphical user interface tool created by MySQL development team behind the powerful MySQL RDMS. This tools is created for both Developers and Database administrators. It is a handy tool for general administration and maintenance of MySQL database systems. It can also be used for MariaDB databases – fork of MySQL. Before you begin installation, it is worth taking note of available MySQL Workbench editions. MySQL Workbench Community Edition MySQL Workbench Standard Edition MySQL Workbench Enterprise Edition It is recommended you review your business requirements, team size before choosing an edition to go with. As this guide is created for home users, we’ll be helping you with the installation of the MySQL Workbench Community Edition in your Linux Desktop. I expect you to have a working CentOS 8|Rocky Linux 8|AlmaLinux 8 OS with graphical interface as this tool is for Desktop and not Server operating systems. It could be possible to run it through an SSH X session but this has not been tested. Some key features that you’ll get from MySQL Workbench Community Edition are: User and Session Management: Manage application roles, users and sessions from graphical interface. Visual SQL Development: You’ll get SQL Code Editor, Completion, Formatter, Syntax Highlighting, Code Generation, Snippets, and use of history. Data Management: Import and export, Quickly locate hard to find rows or cells and table Data Search. Visual Database Administration: You’ll be able to Stop/Start servers locally and remotely, View key server diagnostic information, View and parse slow and error logs, view and edit server settings, View and edit MySQL Replication settings. Connection Management: Configure connections to MySQL Servers and Configure SSH connections to local and remote servers. Visual Data Modeling: Auto Layout, Model Stored Procedures, Triggers, Functions, Model User Security and Auto Layout. Schema Synchronization Reverse Engineering from SQL Script and from Live Database. Install MySQL Workbench on CentOS 8|Rocky Linux 8|AlmaLinux 8 The next sections will demonstrate step-by-step installation of MySQL Workbench on your Desktop machine. If you have not done a recent update of your operating system I’ll recommend you fire commands below in your terminal to make sure you’re rolling on latest OS updates. sudo dnf -y update Add MySQL Repository to CentOS 8|Rocky Linux 8|AlmaLinux 8 Wait for the system to be started if you performed an upgrade as guided in previous step. Once the system comes up, add MySQL YUM repository which is officially created and maintained by MySQL development team. You can download the repository installation rpm file and run it locally or install from the URL with dnf command. I prefer the latter for ease of use. sudo dnf -y install https://dev.mysql.com/get/mysql80-community-release-el8-4.noarch.rpm RPM package details can be viewed with the rpm command line tool. $ rpm -qi mysql80-community-release Name : mysql80-community-release Version : el8 Release : 4 Architecture: noarch Install Date: Fri Jun 3 12:01:40 2022 Group : System Environment/Base Size : 8853 License : GPLv2 Signature : RSA/SHA256, Wed Apr 27 23:00:35 2022, Key ID 467b942d3a79bd29 Source RPM : mysql80-community-release-el8-4.src.rpm Build Date : Wed Apr 27 22:56:43 2022 Build Host : pb2-el8-01.regionaliad02.mysql2iad.oraclevcn.com
Relocations : (not relocatable) Packager : MySQL Release Engineering Vendor : MySQL URL : http://dev.mysql.com Summary : MySQL repository configuration for yum Description : Package for installation of setup/configuration files required for installation of MySQL packages by yum. If you check repository files directly you should see a new file written by the installer package. $ ls /etc/yum.repos.d/mysql-community* /etc/yum.repos.d/mysql-community-debuginfo.repo /etc/yum.repos.d/mysql-community-source.repo /etc/yum.repos.d/mysql-community.repo Install MySQL Workbench on CentOS 8|Rocky Linux 8|AlmaLinux 8 The repository for MySQL is enabled by default and no further action is required before using it. $ cat /etc/yum.repos.d/mysql-community.repo [mysql80-community] name=MySQL 8.0 Community Server baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/8/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-connectors-community] name=MySQL Connectors Community baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/8/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-community] name=MySQL Tools Community baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/8/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-preview] name=MySQL Tools Preview baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/8/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-cluster-8.0-community] name=MySQL Cluster 8.0 Community baseurl=http://repo.mysql.com/yum/mysql-cluster-8.0-community/el/8/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Update YUM package index. $ sudo dnf makecache timer CentOS-8 - AppStream 2.2 kB/s | 4.3 kB 00:01 CentOS-8 - Base 8.6 kB/s | 3.9 kB 00:00 CentOS-8 - Extras 2.2 kB/s | 1.5 kB 00:00 Extra Packages for Enterprise Linux Modular 8 - x86_64 30 kB/s | 61 kB 00:02 Extra Packages for Enterprise Linux 8 - x86_64 39 kB/s | 61 kB 00:01 MySQL 8.0 Community Server 350 kB/s | 919 kB 00:02 MySQL Connectors Community 19 kB/s | 33 kB 00:01 MySQL Tools Community 91 kB/s | 109 kB 00:01 Metadata cache created. You can then run the command to install MySQL Workbench tool on CentOS 8|Rocky Linux 8|AlmaLinux 8: sudo dnf install mysql-workbench-community On executing the command above you’ll be asked to confirm package installation by pressing y or Y key.
.... Transaction Summary ====================================================================================================================================================================================================== Install 51 Packages Total download size: 87 M Installed size: 360 M Is this ok [y/N]: y The package to be downloaded is around 33M and this should be quick if you have moderate speed internet connection. Make sure you import GPG key during installation. If you happen to hit the n key installation will be aborted. .... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Total 35 MB/s | 87 MB 00:02 MySQL Tools Community 3.0 MB/s | 3.1 kB 00:00 Importing GPG key 0x3A79BD29: Userid : "MySQL Release Engineering " Fingerprint: 859B E8D7 C586 F538 430B 19C2 467B 942D 3A79 BD29 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022 Is this ok [y/N]: y Key imported successfully MySQL Tools Community 1.9 MB/s | 1.9 kB 00:00 Importing GPG key 0x5072E1F5: Userid : "MySQL Release Engineering " Fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql Is this ok [y/N]: y Using MySQL Workbench on CentOS 8|Rocky Linux 8|AlmaLinux 8 Once installation is confirmed to have finished without errors MySQL Workbench application can be launched from DE launcher by typing “MySQL” keyword and selecting from the list. You’ll get welcome page for MySQL Workbench. This confirms installation was successful and application can run. Click on Database > Connect to Database to create first connection to a database server. Provide Database server hostname or IP, port number and password for connection. Use “Store in Keychain” for password. Confirm the connection is working by clicking on “Server Status” to check server details. You have MySQL Workbench installed and working on CentOS 8|Rocky Linux 8|AlmaLinux 8 Desktop machine. The next stage is to go through documentation pages to understand how MySQL Workbench works and how you can use it for faster development.
0 notes
Text
Questions: How to Install PHP on CentOS 8 / RHEL 8?, how to install PHP 7.2 on CentOS 8 / RHEL 8??. Welcome to our guide on how to Install PHP 7.2 on CentOS 8 / RHEL 8. Red Hat Enterprise Linux 8 and CentOS 8 are distributed with PHP 7.2 unlike PHP 5.4 which was distributed in RHEL 7. Some of the most notable changes in PHP 7.2 are: FastCGI Process Manager (FPM) is used by default. This is safe for use with a threaded http When the max_execution_timeconfiguration variable is changed, its value should match the httpd ProxyTimeout setting PHP script warning and errors are no longer logged to,/var/log/httpd/error.log they are now logged to the file/var/log/php-fpm/www-error.log. The php-flag and php_value variables should be set in the pool configuration file /etc/php-fpm.d/*.conf. They are no longer configured in the httpd configuration files. The user running PHP scripts is now configured in the FPM pool configuration file – /etc/php-fpm/d/www.conf. The default user is apache. Whenever you install a new extension or change PHP configuration file, you’ll need to restart the php-fpm service Extensions removed on PHP 7.2 Below are the extensions that have been deprecated in PHP 7.2 memcache zip mysql (note that the mysqli and pdo_mysql extensions are still available, provided by php-mysqlnd package) aspell PHP 7.2 is available on the AppStream repository: sudo yum repolist You can confirm enabled and default PHP module by running the following command in your terminal. $ sudo yum module list php Name Stream Profiles Summary php 7.2 [d] common [d], devel, minimal PHP scripting language php 7.3 common [d], devel, minimal PHP scripting language php 7.4 common [d], devel, minimal PHP scripting language Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled For the installation of PHP 7.3 on RHEL 8, check: How to Install PHP 7.3, PHP 7.3-FPM on RHEL 8 Install PHP 7.2 on RHEL 8 / CentOS 8 Install PHP 7.2 on RHEL 8 / CentOS 8 by running the command below sudo yum module install php:7.2 The command above will install a number of PHP extensions as well required for different integrations. After the installation is complete, check your PHP version using the following command: $ php -v PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies As seen in the output above, we have PHP 7.2.11 on our RHEL 8 system. Start and Configure php-fpm service Now activate php-fpm service sudo systemctl enable --now php-fpm Confirm service status $ systemctl status php-fpm ● php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2022-05-06 00:25:52 EAT; 8s ago Main PID: 33849 (php-fpm) Status: "Ready to handle connections" Tasks: 6 (limit: 49359) Memory: 9.7M CGroup: /system.slice/php-fpm.service ├─33849 php-fpm: master process (/etc/php-fpm.conf) ├─33850 php-fpm: pool www ├─33851 php-fpm: pool www ├─33852 php-fpm: pool www ├─33853 php-fpm: pool www └─33854 php-fpm: pool www May 06 00:25:52 rocky-linux-8.localdomain systemd[1]: Starting The PHP FastCGI Process Manager... May 06 00:25:52 rocky-linux-8.localdomain systemd[1]: Started The PHP FastCGI Process Manager. Note that by default PHP FPM service listens on a Unix socket – /run/php-fpm/www.sock Installing PHP 7.2 extensions
Use the syntax: sudo yum install php- Example below is for installing standard PHP extensions. sudo yum -y install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-json Testing your PHP installation Finally, let’s test to confirm that our PHP is working as expected. Install Apache HTTP Server using: sudo dnf -y module install httpd Then Active the service sudo systemctl enable --now httpd Create a test PHP page echo '
0 notes