In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Redis+rabbitmq+mysql environment deployment and the use of MySQL data, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
Installation environment:
Redis:redis-3.0.7.tar.gz
Mysql:mysql-5.7.23-1.el6.x86_64.rpm-bundle.tar
Rabbitmq:rabbitmq-server-3.7.17-1.el7.noarch.rpm
Plug-in: otp_src_20.1
Erlang-solutions-1.0-1.noarch.rpm
Socat-1.7.2.4-1.el7.rf.x86_64.rpm
Tcl8.6.1-src.tar.gz
Operating system: Linux el7.x86_64
Download address of the official website software:
Complete plug-ins and installation packages in https://download.csdn.net/my/uploads/1/3 CSDN
Download address of mysql official website: https://downloads.mysql.com/archives/community/
Download address of Redis official website: http://download.redis.io/releases/
Erlang download address http://erlang.org/download/
Rabbitmq download address https://github.com/rabbitmq/rabbitmq-server/releases/download/ and
Https://bintray.com/rabbitmq/rpm/rabbitmq-server
Tcl8.5 download address http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
Socat1.7 https://pkgs.org/download/socat
Glibc http://ftp.gnu.org/gnu/glibc/
Plug-ins and software downloads:
Wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
Wget http://www.erlang.org/download/otp_src_20.1.tar.gz
Wget http://download.redis.io/releases/redis-3.0.7.tar.gz
Wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.0/rabbitmq-server-generic-unix-3.7.0.tar.xz
Https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.23-1.el6.x86_64.rpm-bundle.tar
1.redis installation
Yum-y install make gcc gcc-c++ kernel-devel M4 ncurses-devel openssl-devel unixODBC unixODBC-devel httpd python-simplejson tcl libtool libtool-ltdl-devel tcl socat
Error message:
Tar-zxvf redis-3.0.7.tar.gz
Cd redis-3.0.7
[root@master redis-3.0.7] # make
Cd src & & make all
Make [1]: Entering directory/aas/redis-3.0.7/src' Hint: It's a good idea to run 'make test';) make [1]: Leaving directory/aas/redis-3.0.7/src'
This is a prompt to do an installation test.
Make
Make test
Make PREFIX=/aas/redis install
Go to the installation directory of redis
Note: go to the bin directory in the installation directory / aas/redis/ and have the server and client of redis to prove that the installation is successful.
By default, Redis does not run in the background. We need to run redis in the background. Vi redis.conf changes the value of daemonize to yes.
Go to the utils directory of the redis package, cd myFile/tool/redis-3.0.0/utils, find the intall_server.sh command, and execute the following statement:
. / install_server.sh # then enter all the way, and select redis-server under bin to execute the file.
Change the startup service redis_6379 to redis, and this change will not affect
Edit the ~ / .bash_profile file as follows:
Export REDIS_HOME=/aas/redis/
Export PATH=$PATH:$REDIS_HOME/bin
Effective immediately:
Source / .bash_profile
Connect successfully with redis client
[root@host-172-168,0129 ~] # redis-cli
127.0.0.1purl 6379 >
127.0.0.1purl 6379 >
The database and database of redis are isolated from each other. Use the parameter-n to switch.
Switch to the second database
Redis-cli-n 2
127.0.0.1 keys 6379 [2]
(empty list or set)
127.0.0.1 help set 6379 [15]
SET key value [EX seconds] [PX milliseconds] [NX | XX]
Summary: Set the string value of a key
Since: 1.0.0
Group: string
127.0.0.1 help keys 6379 [15]
KEYS pattern
Summary: Find all keys matching the given pattern
Since: 1.0.0
Group: generic
Use the command help to retrieve help information
Redis sets the account password:
1. Set the password after login:
Login account:. / redis-cli-p 6379
Set password: config set requirepass 123456
Enter your password when logging in: auth 123456
View password: config get requirepass
Redis-cli-p 6379-a password
two。 Modify the configuration file
# vim redis.conf
Change the password for this line
Requirepass 123456
Installation of 2.rabbitmq and plug-in erlang
Wget www.rabbitmq.com/releases/erlang/erlang-18.3-1.el7.centos.x86_64.rpm
Wget www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-3.6.5-1.noarch.rpm
Wget https://pkgs.org/download/socat/socat-1.7.2.4-1.el7.rf.x86_64.rpm
Rpm-ivh erlang-18.3-1.el7.centos.x86_64.rpm
Rpm-ivh socat-1.7.2.4-1.el7.rf.x86_64.rpm
Rpm-ivh rabbitmq-server-3.6.5-1.noarch.rpm
[root@master 1] # rpm-ivh erlang-18.3-1.el7.centos.x86_64.rpm
Error: Failed dependencies:
Libc.so.6 (GLIBC_2.14) (64bit) is needed by erlang-18.3-1.el7.centos.x86_64
Libc.so.6 (GLIBC_2.15) (64bit) is needed by erlang-18.3-1.el7.centos.x86_64
[root@master 1] # rpm-ivh erlang-18.3-1.el7.centos.x86_64.rpm-- nodeps
Preparing... # [100%]
1:erlang # # [100%]
An error was reported when erl started:
[root@master 1] # erl
/ usr/lib64/erlang/erts-7.3/bin/erlexec: / lib64/libc.so.6: version `GLIBC_2.14' not found (required by / usr/lib64/erlang/erts-7.3/bin/erlexec)
It is recommended to install the library files of GLIBC_2.15 directly. If you only install the latter erl command of 2.14, you will not use it.
[root@master lib64] # ll / lib64/libc.so.6
Lrwxrwxrwx. 1 root root 12 April 23 2018 / lib64/libc.so.6-> libc-2.12.so
Note: the current one is libc-2.12.so, the GLIBC_2.14 required by the software
[root@master 1] # strings / usr/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH
There is no GCC version GLIBC_2.14 required in the dynamic library, so we need to upgrade our GCC version
The process is as follows:
GLIBC_2.14 dynamic library upgrade
Glibc http://ftp.gnu.org/gnu/glibc/
You can download and install it yourself, or you can copy a compiled file libc.so.6 from another machine.
Downloaded a glibc-2.14.tar.xz
Tar xvf glibc-2.14.tar.xz
Mkdir glibc-build-2.14
. / glibc-2.14/configure-- prefix=/usr/
Make & & make install
After the installation is complete:
Cp / lib64/glibc-build-2.14/glibc-build-2.14/libc.so / lib64/libc-2.14.so
Rm-rf / lib64/libc.so.6
LD_PRELOAD=/lib64/libc-2.14.so ln-s / lib64/libc-2.14.so / lib64/libc.so.6
If you want to switch back, use ln-s / lib64/libc-2.12.so / lib64/libc.so.6 or
LD_PRELOAD=/lib64/libc-2.12.so ln-s / lib64/libc-2.12.so / lib64/libc.so.6
[root@master glibc-build-2.14] # strings / lib64/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_PRIVATE
Use the command erl after you have GLIBC_2.14.
/ usr/lib64/erlang/erts-7.3/bin/beam: / lib64/libc.so.6: version `GLIBC_2.15' not found (required by / usr/lib64/erlang/erts-7.3/bin/beam)
Repeat the above steps to install 2.15
[root@master glibc-build-2.15] # strings / lib64/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_PRIVATE
[root@master glibc-build-2.15] # erl
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.3 (abort with ^ G)
1 > strings / lib64/libc.so.6 | grep GLIBC
1 >
To prove that the erlang installation is complete, let's start installing rabbitmq
Install the plug-in socat
[root@master 1] # rpm-ivh socat-1.7.3.2-1.el6.lux.x86_64.rpm
Warning: socat-1.7.3.2-1.el6.lux.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 53e4e7a9: NOKEY
Preparing... # [100%]
1:socat # # [100%]
[root@master 1] # rpm-ivh rabbitmq-server-3.7.17-1.el6.noarch.rpm
Warning: rabbitmq-server-3.7.17-1.el6.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 6026dfca: NOKEY
Preparing... # [100%]
1:rabbitmq-server # # [100%]
Start mq after installation is complete
[root@master ~] # rabbitmq-server start &
[1] 10937
[root@master ~] # {"init terminating in do_boot", {undef, [{rabbit_prelaunch,start, [], []}, {init,start_it,1, []}, {init,start_em,1, []}
Crash dump is being written to: / var/log/rabbitmq/erl_crash.dump...done
Init terminating in do_boot ()
[1] + Exit 1 rabbitmq-server start
Use the command ps-ef | grep rabbitmq to view the process
[root@master ~] # rabbitmq-plugins list
Configured: e = explicitly enabled; e = implicitly enabled
| | Status: = running on rabbit@master |
| /
[e] amqp_client 3.6.5
[] cowboy 1.0.3
[] cowlib 1.0.1
[e] mochiweb 2.13.1
[] rabbitmq_amqp1_0 3.6.5
[] rabbitmq_auth_backend_ldap 3.6.5
[] rabbitmq_auth_mechanism_ssl 3.6.5
[] rabbitmq_consistent_hash_exchange 3.6.5
[] rabbitmq_event_exchange 3.6.5
[] rabbitmq_federation 3.6.5
[] rabbitmq_federation_management 3.6.5
[] rabbitmq_jms_topic_exchange 3.6.5
[E] rabbitmq_management 3.6.5
[e] rabbitmq_management_agent 3.6.5
[] rabbitmq_management_visualiser 3.6.5
[] rabbitmq_mqtt 3.6.5
[] rabbitmq_recent_history_exchange 1.2.1
[] rabbitmq_sharding 0.1.0
[] rabbitmq_shovel 3.6.5
[] rabbitmq_shovel_management 3.6.5
[] rabbitmq_stomp 3.6.5
[] rabbitmq_top 3.6.5
[] rabbitmq_tracing 3.6.5
[] rabbitmq_trust_store 3.6.5
[e] rabbitmq_web_dispatch 3.6.5
[] rabbitmq_web_stomp 3.6.5
[] rabbitmq_web_stomp_examples 3.6.5
[] sockjs 0.3.4
[e] webmachine 1.10.3
[root@master ~] # ss-nalp | grep 15672
Tcp LISTEN 0 128: 15672: users: ("beam.smp", pid=6066,fd=53)
Access using IP and port
When you get here, the installation is complete.
3. Install mysql
It's very simple, download it from the Internet and install it directly.
[root@master 1] # rpm-ivh mysql*.rpm-nodeps-force
Preparing... # [100%]
1:mysql-community-common # [11%]
2:mysql-community-libs # [22%]
3:mysql-community-client # [33%]
4:mysql-community-server # [44%]
5:mysql-community-devel # [56%]
6:mysql-community-embedde### [67%]
7:mysql-community-embedde### [78%]
8:mysql-community-test # [89%]
9:mysql-community-libs-co### [100%]
[root@master 1] #
[root@master 1] # / etc/init.d/mysqld start
Starting mysqld [OK]
Basic operation of mysql:
The show databases; command to see which databases have been created.
Get table structure command: desc table name, or show columns from table name
Shou tables views all the tables
Use database1; switch database
Mysql-h hostname-u user name-p
-p: password login, if the login user name password is empty, you can ignore this option.
-D: selected database name
Reset the database password for mysql
1. First stop the mysql database is usually installed in / etc/init.d/mysqld stop
2. Modify the configuration file / etc/my.cnf of mysql
Adding skip-grant-tables on the last line means you can skip permissions to log in.
3. Restart mysql database / etc/init.d/mysqld start
3. Use mysql-u root-p
4. Modify the user in the mysql table and set the password for it.
Update user set password=PASSWORD ("123456") where user='123456'
5. Modify the configuration file to delete or disable the line skip-grant-tables.
Note: the old version of mysql database uses the parameter authentication_string, and the new version uses the parameter password.
Update user set authentication_string=password ('123456') where user='root'
Update user set password=password ('123456') where user='root'
Create a database
Create database test character set gbk
Test and build table
Create table test (id int,name varchar (20), bianma varchar (20))
INSERT INTO test VALUES (1 recording tom1 recording 13 211')
INSERT INTO test VALUES (2 memorials, tom2 girls, 13 212')
INSERT INTO test VALUES (3 recordings tom3 minutes 13 13')
INSERT INTO test VALUES (4 recollection tom4)
Mysql can set pagesize and linesize like Oracle's sqlplus
Select * from table_name\ G
Select can be applied after where in mysql delete
Delete test_user from test_user a, (select id from test_user where id < 10) b
Where a.id = b.id
The table data is too large to view only 5 rows.
Select from gp_plat_user where rownum < 6
Select from gp_plat_user limit 6
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.