Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


centos_7_migration_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
centos_7_migration_notes [2019/04/30 20:44] juckinscentos_7_migration_notes [2023/12/14 10:10] juckins
Line 2: Line 2:
  
 RHEL5/6/7 Cheatsheet: {{:rhel_5_6_7_cheatsheet_201410.pdf|}} RHEL5/6/7 Cheatsheet: {{:rhel_5_6_7_cheatsheet_201410.pdf|}}
 +
 +[[https://tuxcare.com/extended-lifecycle-support/ Tuxcare's CentOS 7 Extended Support]]
 +
 +
 +14 Dec 2023 (for Dell XPS 8930 tower):
 +  * Updated kernel from kernel-3.10.0-1160.102.1.el7.x86_64 to kernel-3.10.0-1160.105.1.el7.x86_64
 +  * Attempted to rebooted machine but after the BIOS splash screen, only got a blank screen with blinking cursor in upper-left corner 
 +  * Restarted machine using the power button but had same condition
 +  * Restarted once again but at the BIOS splash screen selected F12
 +  * For boot options, chose Boot from Hard Drive and list of kernels appeared
 +  * Chose latest kernel and machine was OK
 +  * After machine was running, did another restart and machine powered up with no issues
 +
 +23 Oct 2023 (for Dell XPS 8930 tower)
 +  * Updated kernel from kernel-3.10.0-1160.99.1.el7.x86_64 to kernel-3.10.0-1160.102.1.el7.x86_64 and then machine would not boot, just blank screen with blinking cursor in upper-left corner
 +  * Powered off machine, unplugged the USB peripheral cables
 +  * Unplugged power cable for 30 seconds
 +  * Rebooted and used F12 to go into BIOS Boot Options
 +  * Tried to boot to Hard Drive but that immediately failed with error 'press any key to reboot'
 +  * After that, the machine booted up OK and the normal selection of kernels appeared
  
 Other fixes: Other fixes:
Line 7: Line 27:
   * Disable WiFi LAN connection with ''# nmcli radio wifi off''   * Disable WiFi LAN connection with ''# nmcli radio wifi off''
   * [[https://unix.stackexchange.com/questions/152691/how-to-disable-beep-sound-in-linux-centos-7-command-line|Disable bell]]   * [[https://unix.stackexchange.com/questions/152691/how-to-disable-beep-sound-in-linux-centos-7-command-line|Disable bell]]
 +
 +11 Oct 2020:
 +  * Keep getting errors in python3 script connecting/updating to mariadb server 
 +      * ''OSError: [Errno 99] Cannot assign requested address''
 +      * ''pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' ([Errno 99] Cannot assign requested address)")''
 +  * Updated /etc/my.cnf.d/server.cnf with this setting under [mariadb-5.5]
 +
 +  max_connections = 818 (Note that 818 seems to be the absolute limit)
 +  back_log = 1024 (Note that OS limit is in /proc/sys/net/ipv4/tcp_max_syn_backlog)
 +  thread_cache_size = 818
 +  thread_handling = pool-of-threads
 +  
 +Then do: ''systemctl restart mariadb.service''
 +
 +  * Other commands to check and modify on mariadb server:
 +      * ''show variables like "max_connections";''
 +      * ''show global status like "Threads_connected";''
 +      * ''show status like "Conn%";''
 +      * ''show status like "Threads%";''
 +      * ''show global status;''
 +  * See https://mariadb.com/kb/en/configuring-mariadb-for-optimal-performance/
 +  * Also check python3 coding best practices for opening/closing database connections
 +    * I have noted that opening and closing the database connection only once in the python script helps reduce database "cannot assign requested address" errors
 +  * [[https://pypi.org/project/mysqlclient/|mysqlclient]] is supposedly [[https://stackoverflow.com/questions/43102442/whats-the-difference-between-mysqldb-mysqlclient-and-mysql-connector-python|faster than alternatives]]
 +      * import MySQLdb
 +      * See examples at https://www.tutorialspoint.com/python/python_database_access.htm
 +
 +  #!/usr/bin/python
 +  
 +  import MySQLdb
 +  
 +  # Open database connection
 +  db = MySQLdb.connect("localhost","testuser","test123","TESTDB" )
 +  
 +  # prepare a cursor object using cursor() method
 +  cursor = db.cursor()
 +  
 +  # execute SQL query using execute() method.
 +  cursor.execute("SELECT VERSION()")
 +  
 +  # Fetch a single row using fetchone() method.
 +  data = cursor.fetchone()
 +  print "Database version : %s " % data
 +  
 +  # disconnect from server
 +  db.close()
 +
 +
 +16 May 2020:
 +  * System randomly reboots when KVM toggles back and forth from Dell XPS 8930 (running CentOS 7 as 'tidewater') and HP Pavilion P7-1240
 +    * Workaround: Use remmina to RDP to local Windows machine
 +  * Noticed monitoring emails not being sent from tidewater; postfix not running and won't start. mysql error.
 +  * yum reinstall <mysql_package> that was failing
 +  * postfix started
 +  * Other trouble...had to completely uninstall PHP
 +  * Reinstall PHP - that is v5.4
 +  * Then upgrade to REMI php v7.4
 +  * Look in the bash setup script to install the needed php files
 +  * Restore /etc/php.ini from a local VM
 +  * restart httpd service
 +  * yum update had many instances of 'empty files'....it fixed itself
 +  * ldconfig gave errors for 2 more things
 +    * yum reinstall oniguruma5
 +    * yum reinstall oniguruma
 +  * reboot system, came up cleanly
 +  * may need to check if mysql connection limit needs to be increased
 +
  
 13 December 2016: 13 December 2016:
Line 69: Line 156:
     * [[http://www.uptimemadeeasy.com/linux/mysql-migrate-users-server-server/|Migrate MySQL users to new machine]]     * [[http://www.uptimemadeeasy.com/linux/mysql-migrate-users-server-server/|Migrate MySQL users to new machine]]
       * Don't forget to add semicolons with this:  # sed -i ‘/[^;] *$/s/$/;/’ ./grantfile       * Don't forget to add semicolons with this:  # sed -i ‘/[^;] *$/s/$/;/’ ./grantfile
 +      * Note: I used phpMyAdmin to export users from a VM (get the SQL syntax) and then run that on the new machine
   * export MySQL databases with mysqldump   * export MySQL databases with mysqldump
     * [[https://www.digitalocean.com/community/tutorials/how-to-migrate-a-mysql-database-between-two-servers|Migrate MySQL database to new server]]     * [[https://www.digitalocean.com/community/tutorials/how-to-migrate-a-mysql-database-between-two-servers|Migrate MySQL database to new server]]
Line 74: Line 162:
   * list of installed perl modules   * list of installed perl modules
     * grep all .pl script and look for the "use " calls     * grep all .pl script and look for the "use " calls
 +  * list of installed python (pip) modules
   * Copy the following to accessible location for restore after upgrade   * Copy the following to accessible location for restore after upgrade
     * users' $HOME     * users' $HOME
Line 81: Line 170:
     * /etc/hosts     * /etc/hosts
     * /etc/httpd/conf/httpd.conf     * /etc/httpd/conf/httpd.conf
-    * /etc/samba/smb.conf +    * Samba users, passwords, shares (for security cameras) 
-      * Samba users, passwords, shares +      * /etc/samba/smb.conf 
-  * nxclient-3.5.0-7.x86_64.rpm +        * smbpasswd -a <username> 
-  * nxnode-3.5.0-9.x86_64.rpm +          * <password> 
-  * nxserver-3.5.0-11.x86_64.rpm+      * /var/lib/samba/private/passdb.tbd 
 +      * /var/lib/samba/private/secrets.tbd 
 +      * Make sure service is running and will start at boot. 
 +      * Check output with: testparm -v 
 +  * <del>nxclient-3.5.0-7.x86_64.rpm</del> 
 +  * <del>nxnode-3.5.0-9.x86_64.rpm</del> 
 +  * <del>nxserver-3.5.0-11.x86_64.rpm</del>
   * <del>skype-4.3.0.37-fedora.i586.rpm</del>   * <del>skype-4.3.0.37-fedora.i586.rpm</del>
   * verify services that should be installed/running in chkconfig   * verify services that should be installed/running in chkconfig
Line 226: Line 321:
   * [[gmail_as_a_relay_on_linux|Set up Gmail Relay and test]]   * [[gmail_as_a_relay_on_linux|Set up Gmail Relay and test]]
   * Disable SELinux   * Disable SELinux
-  * VSFTP +  * VSFTP (for security cameras)
     * [[http://www.liquidweb.com/kb/how-to-install-and-configure-vsftpd-on-centos-7/|Config instructions]]     * [[http://www.liquidweb.com/kb/how-to-install-and-configure-vsftpd-on-centos-7/|Config instructions]]
     * [[https://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/|500 writeable root error]]     * [[https://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/|500 writeable root error]]
-    * As root: setsebool -P allow_ftpd_full_access on +    * As root (if selinux is enabled): setsebool -P allow_ftpd_full_access on 
     * As root: systemctl restart vsftpd     * As root: systemctl restart vsftpd
 +    * As root: systemctl enable vsftpd
   * Samba   * Samba
-    * [[http://www.unixmen.com/install-configure-samba-server-centos-7/|UnixMen.com - Samba on CentOS 7]] +    * [[samba_file_sharing|Samba File Sharing]]
-    * [[https://www.howtoforge.com/samba-server-installation-and-configuration-on-centos-7|HowToForge - Samba on CentOS 7]]+
   * <del>Skype</del>   * <del>Skype</del>
   * Virtual Box   * Virtual Box
   * Working crontabs for each user   * Working crontabs for each user
 +  * [[python_notes|Install Python 3]]
 +
 +Optional:
 +  * [[https://gorilla.dp100.com/downloads/|Password Gorilla]] (use standalone executable)
  
 Contents of /etc/yum.repos.d (CentOS 7): Contents of /etc/yum.repos.d (CentOS 7):
Line 296: Line 395:
  
   * Preferable to use local .iso file to conserve bandwidth for multiple installs    * Preferable to use local .iso file to conserve bandwidth for multiple installs 
-  * Used http://mirror.centos.org/centos/7.1.1503/os/x86_64/ for package repository+  * Used http://mirrors.sonic.net/centos/7.7.1908/os/x86_64/ for package repository
   * On initial config screen, ensure the network connection is activated   * On initial config screen, ensure the network connection is activated
   * You can also disable SELinux   * You can also disable SELinux
Line 354: Line 453:
     * Yet another option is to use modules that are in a repository     * Yet another option is to use modules that are in a repository
  
-[[http://www.if-not-true-then-false.com/2010/install-adobe-flash-player-10-on-fedora-centos-red-hat-rhel/|Ensure Adobe Flash plugin is installed]]+<del>[[http://www.if-not-true-then-false.com/2010/install-adobe-flash-player-10-on-fedora-centos-red-hat-rhel/|Ensure Adobe Flash plugin is installed]]</del>
  
 [[http://www.cyberciti.biz/faq/howto-install-linux-apache-mariadb-php-lamp-stack-on-centos7-rhel7/|Ensure Apache is installed and running]] [[http://www.cyberciti.biz/faq/howto-install-linux-apache-mariadb-php-lamp-stack-on-centos7-rhel7/|Ensure Apache is installed and running]]
Line 361: Line 460:
   * [[http://howtolamp.com/lamp/httpd/2.4/customizing/|Tips for users and permissions #2]]   * [[http://howtolamp.com/lamp/httpd/2.4/customizing/|Tips for users and permissions #2]]
  
-[[centos_php7.2_upgrade|Upgrade PHP to version 7.2]]+<del>[[centos_php7.2_upgrade|Upgrade PHP to version 7.2]]</del> 
 + 
 +[[https://computingforgeeks.com/how-to-install-php-7-4-on-centos-7/|Upgrade PHP to version 7.4]]
  
 Migrate /etc/php.ini from old server and relax settings due to test env: Migrate /etc/php.ini from old server and relax settings due to test env:
Line 389: Line 490:
  
 Database work: Database work:
 +  * Update /etc/my.cnf.d/server.cnf with this setting under [mariadb-5.5]
 +    * ''max_connections = 800''
 +    * ''systemctl restart mariadb.service''
   * Backup /etc/my.cnf   * Backup /etc/my.cnf
     * Add this line under [mysqld]     * Add this line under [mysqld]
Line 400: Line 504:
     * Ensure database on target server exists; create if necessary     * Ensure database on target server exists; create if necessary
       * Tables migrated should be MyISAM       * Tables migrated should be MyISAM
-      * Default database engine is InnoDB as<color #ed1c24>Red Highlighted Text</color> of MySQL 5.5+      * Default database engine is <color #ed1c24>InnoDB</color> as of MySQL 5.5
       * [[https://dev.mysql.com/doc/refman/5.6/en/innodb-default-se.html|Perform some tests and queries]]       * [[https://dev.mysql.com/doc/refman/5.6/en/innodb-default-se.html|Perform some tests and queries]]
         * The exact number of rows of InnoDB tables cannot be shown         * The exact number of rows of InnoDB tables cannot be shown
Line 411: Line 515:
       * systemctl start mariadb.service       * systemctl start mariadb.service
       * systemctl enable mariadb.service       * systemctl enable mariadb.service
-    * mysql DATABASE -h localhost -u USER -p'PASS' < /tmp/DATABASE.sql+    * mysql -u USER -p'PASSWORD' (to login to mysql at command line) 
 +      * CREATE DATABASE database_name; 
 +      * Now logout of command line 
 +    * mysql DATABASE_NAME -h localhost -u USER -p'PASS' < /tmp/DATABASE.sql
  
   * Note CentOS7 comes with PHP 5.4 and latest version of phpMyAdmin that will work is 4.4.x   * Note CentOS7 comes with PHP 5.4 and latest version of phpMyAdmin that will work is 4.4.x
Line 423: Line 530:
   * https://sourceforge.net/p/ddclient/wiki/Home/   * https://sourceforge.net/p/ddclient/wiki/Home/
   * yum -y install ddclient   * yum -y install ddclient
-  * Use /etc/ddclient/* for configs from previous machine+  * In /etc use the ddclient* files for configs from previous machine
  
 Setup duckdns: Setup duckdns:
Line 547: Line 654:
   * Additional tips: http://ubuntuforums.org/archive/index.php/t-941530.html   * Additional tips: http://ubuntuforums.org/archive/index.php/t-941530.html
   * systemctl restart sshd.service   * systemctl restart sshd.service
 +  * User accounts at remove machines connecting to the new machine will need their $HOME/.ssh/known_hosts either rebuilt or offending entries removed
  
 Update GRUB and splash screen Update GRUB and splash screen
Line 555: Line 663:
   * vi grub    * vi grub 
     * remove "rhgb quiet" from the GRUB_CMDLINE_LINUX call     * remove "rhgb quiet" from the GRUB_CMDLINE_LINUX call
-    * add "vga=0x317" to the GRUB_CMDLINE_LINUX call for better screen resolution (or 0x34b for 1920x1200x8, or vga=ask to see all available resolutions)+    * add "vga=0x317" to the GRUB_CMDLINE_LINUX call for better screen resolution (try 0x34b for 1920x1200x8 or 0x34c for 1920x1200x16, or vga=ask to see all available resolutions)
     * comment out this line: GRUB_TERMINAL_OUTPUT="console"     * comment out this line: GRUB_TERMINAL_OUTPUT="console"
     * add this line: GRUB_BACKGROUND="/boot/grub2/splash.png"     * add this line: GRUB_BACKGROUND="/boot/grub2/splash.png"
       * Ensure it is rw-r-r permissions       * Ensure it is rw-r-r permissions
       * [[http://192.168.1.14/dokuwiki/lib/exe/fetch.php?media=splash.png|Upload this image]] to the directory noted above       * [[http://192.168.1.14/dokuwiki/lib/exe/fetch.php?media=splash.png|Upload this image]] to the directory noted above
-  * For VM/BIOS-based installs, as root: grub2-mkconfig -o /boot/grub2/grub.cfg+  * For VM/BIOS-based installs, as root: grub2-mkconfig -o /boot/grub2/grub.cfg (Dell XPS 8930)
   * For UEFI-based installs, as root: grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg   * For UEFI-based installs, as root: grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
   * More info at [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Customizing_the_GRUB_2_Configuration_File.html|Customizing the Grub2 Config File]] and [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Desktop_Migration_and_Administration_Guide/GRUB.html|RHEL7 GRUB Guide]]   * More info at [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Customizing_the_GRUB_2_Configuration_File.html|Customizing the Grub2 Config File]] and [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Desktop_Migration_and_Administration_Guide/GRUB.html|RHEL7 GRUB Guide]]
Line 585: Line 693:
  
 Set up local printer(s) Set up local printer(s)
 +  * Note that Brother has notes for the HL2170W at https://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=hl2170w_all&os=127
 +    * RPM #1: brhl2170wlpr-2.0.2-1.i386.rpm
 +    * RPM #2: cupswrapperHL2170W-2.0.2-1.i386.rpm
 +    * Use 'lpstat' and 'lpq' to ensure it's a known destination printer
   * [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Printer_Configuration.html#sec-Starting_Print_Settings_Config|RHEL7 Print Settings]]   * [[https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Printer_Configuration.html#sec-Starting_Print_Settings_Config|RHEL7 Print Settings]]
   * yum install cups   * yum install cups
centos_7_migration_notes.txt · Last modified: 2023/12/14 10:10 by juckins