Centos 7.3 (1611)使用遇到問題及解決辦法集錦
1.host smbus controller not enable
解決:在/etc/modprobe.d/blacklist.conf
中新增blacklist i2c_piix4,重啟
2.intel_rapl: no valid rapl domains found in package 0
解決:在/etc/modprobe.d/blacklist.conf
中新增blacklist intel_rapl,重啟
3.安裝JDK,配置環境變數之後出現bash: ./java: /lib/ld-Linux.so.2: bad ELF interpreter:
解決:主機聯網,終端安裝軟體:
sudo yum install glibc.i686
4.修改主機名:root使用者登入,
hostnamectl --static set-hostname <host-name>
然後登出就可看到效果
5.安裝Python3.6.1
解壓:tar -zxvf Python-3.6.1.tgz
進入解壓目錄: cd Python-3.6.1
建立安裝目錄: mkdir /usr/local/python3.6.1
編譯: ./configure --prefix=/usr/local/python3.6.1
安裝: make && make install
備份原有python:mv /usr/bin/python /usr/bin/python_2.7 .5
建立軟連線:ln -s /usr/local/python3.6.1/bin/python3.6 /usr/bin/python
6.Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database /usr/local/hive/conf/metastore_db
解決辦法:
ps aux | grep hive
得到hiveserver2的pid,然後通過kill -9 hive_process_id (ex: kill -9 21765)
殺掉
7.啟動hiveserver2
hive --service hiveserver2 &
8.安裝MariaDB
//安裝
yum install mariadb-server
//啟動
systemctl start mariadb
//檢視狀態
systemctl status mariadb
為root使用者配置密碼,輸入mysql,進入MariaDB,然後輸入
mysql_secure_installation
接著同時按住Ctrl+D,這時候會提示為root使用者輸入密碼,輸入一個密碼即可。
9.MariaDB/MySQL忘記(root)密碼:
vi /etc/my.cnf
加上這句話:
skip-grant-tables
儲存退出,重新啟動MariaDB:
輸入mysql:
USE mysql;
UPDATE user SET Password = password ( 'NewPassword' ) WHERE User = 'root' ;
flush privileges;
重啟伺服器
systemctl restart mariadb.service
10.kafka執行自定義的生產者、消費者
- 首先被打包好的jar包放到kafka的lib目錄下,然後在叢集啟動的前提下:
啟動生產者
//bin/kafka-run-class.sh 包名+類名
bin/kafka-run-class.sh v010.Producer
啟動消費者:
//bin/kafka-run-class.sh 包名+類名
bin/kafka-run-class.sh v010.Consumer
其他方法:
java -jar 絕對路徑+包名+類名
11.kafka建立Topic
//建立Topic
bin/kafka-topics.sh --create --zookeeper 172.17.11.105:2181,172.17.11.106:2181,172.17.11.107:2181 --replication-factor 3 --partitions 4 --topic TOPIC-20170510
12.kafka檢視單一的TOpic的資訊
bin/kafka-topics.sh --describe --zookeeper 172.17.11.105:2181,172.17.11.106:2181,172.17.11.107:2181 --topic TOPIC-20170510
13.kafka檢視所有的Topic名稱
bin/kafka-topics.sh --list --zookeeper 172.17.11.105:2181,172.17.11.106:2181,172.17.11.107:2181
14.Centos 最小化安裝的時候ifconfig command not found
centos7之後使用ip addr
代替了ifconfig
15.從Gnome進入終端模式
Ctrl+Alt+F2
16.從終端進入Gnome
startx