Tag Archives: Environment set up

Centos8 modifying the host name

When you modify the host name, you can directly use the tools provided by the system.  

[root@localhost centos]# hostnamectl
   Static hostname: localhost.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 89bf177f78dc49f6b4954e1e9511e267
           Boot ID: 8f46edc8b7b648f58d5d4c1f3c15cbee
    Virtualization: vmware
  Operating System: CentOS Linux 8
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-240.10.1.el8_3.x86_64
      Architecture: x86-64
[root@localhost centos]# sudo hostnamectl set-hostname k8s-slave
[root@localhost centos]# hostnamectl
   Static hostname: k8s-slave
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 89bf177f78dc49f6b4954e1e9511e267
           Boot ID: 8f46edc8b7b648f58d5d4c1f3c15cbee
    Virtualization: vmware
  Operating System: CentOS Linux 8
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-240.10.1.el8_3.x86_64
      Architecture: x86-64
[root@localhost centos]# cat /etc/hostname 
k8s-slave
[root@localhost centos]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@localhost centos]# vi /etc/hosts
[root@localhost centos]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.187.151  k8s-slave
[root@localhost centos]#

 

Analysis of JDBC connection to MySQL

JDBC connection to MySQL problem resolution
Recently, a series of problems occurred while configuring JDBC to connect to MySQL. Fortunately, it all worked out in the end. Here is a summary of the problems, hoping to help others with the same problems.
BlueStragglers shares the joy of technology growth

directory
A JDBC connection to MySQL analytical error: com.mysql.jdbc.exceptions.jdbc4.Com municationsException: Communications link failure2. Unknown initial character set index ‘255’ received from server.Initial client character3. Error: references to the entity ‘characterEncoding’ must begin with ‘; ‘End of delimiter 4. Reference content

1. An error: com.mysql.jdbc.exceptions.jdbc4.Com municationsException: Communications link failure
This problem is most likely due to a problem with the mysql-connector-java version of the pom.xml file. I started with version 5.1.44 and found that I kept reporting this error. This issue can be resolved by returning 5.1.6.
Of course, there is another case where this error is reported: MySQL Server will automatically disconnect and report an error if the connection takes more than 8 hours. The solution is usually to modify the configuration file.
Unknown initial character set index ‘255’ received from server.Initial client character
This problem is generally caused by the occurrence of Chinese in MySQL, which can not be properly resolved. The solution is to put a UTF8 encoding requirement at the end of the URL to avoid errors. For example, the source statement is:

<property name="url" value="jdbc:mysql://10.201.0.27:3307/mybatis"/>

This can be modified to the following statement:

<property name="url" value="jdbc:mysql://10.201.0.27:3307/mybatis?useUnicode=true&amp;characterEncoding=utf8"/>

3. Error: references to the entity ‘CharacterEncoding’ must begin with ‘; ‘End of the delimiter
Encounter this problem, I am quite surprised, actually is Chinese report error. It was later discovered that MySQL had a problem with characterEncoding= UTF8, so it may have been for this reason that the error was reported in Chinese.
& & instead. For example, the following statement:

<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useSSL=true&characterEncoding=utf8" />

The above statement will report an error. If you need to modify it to the following statement, it will not report an error:

<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useSSL=true&amp;characterEncoding=utf8" />

4. References

    JDBC connection to MySQL references to the entity 'CharacterEncoding' must begin with '; 'End of delimiter

Backup and recovery – rman4

RMAN manual allocation of parallel channels

The article directories
RMAN manual allocation of parallel channels 1. View data file temporary file location 2. Manual channel allocation 3. How to set parallelism to 3

1. View temporary file location of data file

RMAN> report schema;

Report of database schema for database with db_unique_name PROE

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    750      SYSTEM               ***     /u01/app/oracle/oradata/proe/system01.dbf
2    600      SYSAUX               ***     /u01/app/oracle/oradata/proe/sysaux01.dbf
3    90       UNDOTBS1             ***     /u01/app/oracle/oradata/proe/undotbs01.dbf
4    6        USERS                ***     /u01/app/oracle/oradata/proe/users01.dbf
5    346      EXAMPLE              ***     /u01/app/oracle/oradata/proe/example01.dbf
6    20       TEST_1               ***     /u01/app/oracle/oradata/proe/test_1.dbf
7    100      TBS_TRAN             ***     /u01/app/oracle/oradata/proe/tbs_tran01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    29       TEMP                 32767       /u01/app/oracle/oradata/proe/temp01.dbf

2. Manually assign channels

RMAN> run{
2> allocate channel ch1 device type disk format '/u01/app/backup/tbs_%U';
3> backup tablespace TBS_TRAN;
4> release channel ch1;
5> }

allocated channel: ch1
channel ch1: SID=1144 device type=DISK

Starting backup at 10-AUG-20
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/app/oracle/oradata/proe/tbs_tran01.dbf
channel ORA_DISK_1: starting piece 1 at 10-AUG-20
channel ORA_DISK_1: finished piece 1 at 10-AUG-20
piece handle=/u01/app/oracle/fast_recovery_area/PROE/backupset/2020_08_10/o1_mf_nnndf_TAG20200810T140602_hm1rybq5_.bkp tag=TAG20200810T140602 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-AUG-20

3. How to set the parallelism of 3



RMAN> run{
2> allocate channel ch1 device type disk format '/u01/app/backup1/bak1_%U';
3> allocate channel ch2 device type disk format '/u01/app/backup2/bak2_%U';
4> allocate channel ch3 device type disk format '/u01/app/backup3/bak3_%U';
5> backup 
6> (datafile 1 channel ch1)
7> (datafile 2,3 channel ch2)
8> (datafile 4,5,7,8,9,14 channel ch3);
9> release channel ch1;
10> release channel ch2;
11> release channel ch3;
12> }