Contents
1. Installing DiCE
Whenever the global IP is changed, which happens when the Internet is disconnected or the router is disconnected and rebooted, you need to access the dynamic DNS to notify the change of global IP. DiCE does that automatically for you.
1. 1 Download and install Dice
①Download
1 2 3 4 |
# cd /usr/local/bin # wget https://centos.rcg.jp/download/DiCE.tar.gz --no-check-certificate # tar -xzvf DiCE.tar.gz # cd /usr/local/bin/DiCE |
②DiCE settings.
The output characters of DiCE are garbled because of EUC.
To convert them to UTF-8, install nkf.
1 |
# apt-y install nkf |
#To run the 32-bit software Dice on a 64-bit OS
1 |
# apt install lib32stdc++6 |
③Start DiCE
1 2 |
# cd /usr/local/bin/DiCE # ./diced | nkf -uw |
1. 2 Adding an Event
DNS service is VALUEDOMAIN
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# ./diced | nkf -uw : add Please enter the DynamicDNS service name. "?" to list the supported services (P)Return >VALUEDOMAIN Please enter a domain name. "?" to display the list of domains (P)Return ><Domain Name> Please enter a host name. (P)Return ><host name> Please enter your login user name (P)Return ><User Name> ←User name registered in VALUEDOMAIN Please enter your login password. (P)Return ><passwd> ←Password to log in to VALVEDOMAIN Enter the IP address to be registered If left blank, the current IP address will be detected automatically. (P)Return >blank space Please give this event a title. (P)Return >xxxxxxxxx(put something on randomly) Specify the frequency of execution (enter a number) (0)One time only (1)Once a day (2)Once a week (3)Once a month (4)Other cycles (5)When IP address changes(6)startup (point in) time (P)Return >5 If you are in an environment where your IP address does not change often, your account may be deleted after a certain period of time without updating it. If your IP address does not change often, your account may be deleted after a certain period of time without updating. Please specify the interval to run when the IP address does not change. (0)Every 7 days (1)Every 14 days (2)Every 21 days (3)Every 28 days (4)Every 35 days (5)Every 56 days (6)Every 84 days (P)Return >0(decide arbitrarily) Do you want to enable this event? (Y/N) (Enabling/disabling the event can be switched by the "EN/DIS" command.) >y Do you want to save the event? (Y/N) >y |
1. 3 Confirmation of events
1 2 3 4 5 6 7 8 |
: list (No.) (Event Name) (Schedule) (Next back to the decision) 0 * xxxxxxxxx When IP address changes (every 7 days) 07/29 06:27ー Manual execution :ex 0 + ddns_valuedomain was executed on 7/22 6:33 IP address updated. |
1. 4 Automatic execution of Dice
Start the DiCE daemon
1 |
# /usr/local/bin/DiCE/diced -d -l |
Make sure it's running.
1 2 3 |
# ps aux | grep diced root 5346 12.2 0.0 5440 492 ? Ss 06:37 0:04 /usr/local/bin/DiCE/diced -d -l |
Set to start automatically.
1 2 3 |
# vi /etc/rc.local /usr/local/bin/DiCE/diced -d -l ←add |
If you want to become systemd and run the program at startup, write a script to register it as a service.
In Debian, if you write /etc/rc.local as root and set up the execution bit, it will be executed automatically by the rc-local service.
Create a new /etc/rc.local
# vi /etc/rc.local
#!/bin/sh
/usr/sbin/ethtool -s eno1 wol g
※ eno1 is the name of your network interface(# Check with ip addr)
# chmod 700 /etc/rc.local
2. Steps to migrate to MySQL 8.0
Old Server MySQL5.6 Database;test-db Database User;test-db-user
New Server MySQL8.0
2.1 Backup on new server
1 |
# mysqldump -u root -p [New password] --all-databases --single-transaction |
2.2 Working on the old server
①Take a dump of the DB you want to migrate
1 |
# mysqldump -u root -p --flush-logs test-db > test-db.sql |
②If the database engine of the old server is MyISAM, you need to convert it to InnoDB with the following command
1 |
# sed -i 's/ENGINE=MyISAM/Engine=InnoDB/g' test-db.sql |
③Bring the retrieved dump to the new server by rsync or scp.
2.3 Working on the new server
①Create a new database that will be migrated.
1 2 |
# mysql -u root -p mysql>create database test_db; |
②Pour the database of the old server into the new server.
1 |
# mysql -u root -p test_db < test-db.sql |
1 2 3 4 5 6 |
# mysql -u root -p mysql>create user test_db_user@localhost identified by '<PASSWD>'; ※<PASSWD> is arbitrary. mysql> grant all on test_db.* to 'test_db_user'@'localhost'; mysql> flush privileges; mysql> exit |