搜尋

搜尋結果

dockerswarm
科技新知
MacauYeah・2025-11-21

雖然筆者都知道,全世界在講 k8s ,全世界都叫筆者放棄 docker swarm,但無獨有偶,docker swarm 還是有使用的價值。 你只有單個服務在運行,只想要做冗餘或分流。快速地用 docker swarm 做最小可行性産品,推出市場。 傳統的HA功能做到了,但你沒有中央匯整日誌的功能。而你也不想把事情攪得太複雜,使用docker swarm 可以讓你在任何一個管理節點上查看不同 container 的日誌。 你的客戶只提供VM,他可能有自己的k8s平台,但不讓你使用。自建一套docker swarm ,先入場,事後擴展再要求客戶提供k8s,對於客戶來講,先證明系統是有價值的,在金錢成本上或能力上,一定是件比較可以接受的事。 筆者之前介紹過一系列的 docker swarm 教學,但生成群集的部份一直沒有做介紹。因為實在太簡單,所以一直都沒有收納在教學內容當中。但現在考慮其完整性,以及為了讓大家感受一下它有多簡單,所以重新寫了組建群集的步驟。 組成群集 以前各家不同的軟件,想要起一個群集,要左攪右攪,又要重啟。而docker swarm真的很簡單,只要各機中有 docker ,再在各機中順序打指令就好。 node 1 使用docker swarm init docker swarm join-token manager # node 1 > docker swarm init > docker swarm join-token manager To add a manager to this swarm, run the following command: docker swarm join --token SWMTKN-1-xxxxxxxxxxxxxxxxxxxxxxx xxx.xxx.xxx.xxx:2377 其餘的管理員節點就根據上述的提示,使用 docker swarm join --token SWMTKN-1-xxxxxxxxxxxxxxxxxxxxxxx xxx.xxx.xxx.xxx:2377 就好。只要總數的管理員節點有奇數個就可以了(包括當初的node 1)。即是1、3、5等都可以。這是因為在容錯的情況下,必需由管理節點作出多數決,才能容易地知道判斷是哪些節點出現問題。 如果不為容錯,只想增加可工作的機器,那麼我們只需要增加工作節點。我們可以在任何管理員節點生成docker swarm join-token worker > docker swarm join-token worker To add a worker to this swarm, run the following command: docker swarm join --token SWMTKN-1-yyyyyyyyyyyyyyyyyyyyyyy yyy.yyy.yyy.yyy:2377 若想要檢查各個節點的工作狀態,在管理員節點上執行 docker node ls 看到了。 docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION xxxxxxxxxxxxxxxxxxxxxxxxx * node1hostname Ready Active Leader 28.5.1 yyyyyyyyyyyyyyyyyyyyyyyyy * node2hostname Ready Active Reachable 28.5.1 全部教學請見 https://macauyeah.github.io/AProgrammerPrepares/VMDockerNotes/SwarmModeCommandCN.html

codeserver
科技新知
MacauYeah・2025-11-20

之前我們就有探討過 vs code 與 codeserver 的差別,初步結論就是 vs code 的 debug 功能比較完善。如果大家懂得 devcontainer 的使用形式,使用 vs code 應該可以得到最大的效益。就在筆者想跳過 codeserver 的時候,又有新朋友對 codeserver 有興趣。最主要的原因還是它可以一體化預安裝所有事,若大家使用筆者的image,有 docker 、有瀏覽器就已經可以開箱即用。 所以這裏,筆者也重新翻新了筆者版本的使用說明。有興趣使用的朋友可以直接跟 github readme 試用。 https://github.com/wingzero0/codeserverUbuntu 本次翻新,主要加入了常見問題。這些問題部份與 docker 的基本限制有關、部份則是筆者的 env 所限。 常見問題 FAQ 運行 node 應用時很慢 在 windows / mac 下,它們的 docker 是經過 VM 建出來的。若使用 bind mount ,其實是經過 VM 層面抄資料夾。普通 java 開發沒有大問題,但如果遇上 node_module ,就會出現極大效能問題。 node_module 最好還是放在 container 內的 mounted volume 中。本 project 預設的 docker-compose.yaml 就已經有 /home/ubuntu/sourcecode mounted volume ,有需要可以放在其內直接使用。 linux 則沒有這個問題,因為 docker 只是 linux 的一個 process ,可以直接連到資料夾。 mounted volume 權限問題 如果大家自定義 mounted volume ,注意 docker 預設會是 root 權限,本系統使用 local user ubuntu,有需要改為它。 chown -R 'ubuntu:ubuntu' YOUR_TARGE_FOLDER 若然code-server異常,需要重啟。在 host 可以使用 docker command,在 container 中,可能殺掉所有 process # at host, outside of code-server docker compose -f docker-compose.local.yaml stop docker compose -f docker-compose.local.yaml start # at container, inside of code-server killall5 -9 上/下載 上載檔案:可以經過拖拉的方式,把桌面的檔案拖進 code-server 的 Explorer 區域。 下載檔案:可以點選 code-server Explorer區域內的檔案,按滑鼠右鍵,選 Download 。

旅遊情報
莫雪・2025-11-15

七彩童話 ♦甘川洞文化村♦ 又稱甘川洞文化村的韓國釜山甘川洞, 一處依山谷密密建起的房子山城城鎮, 被譽為「韓國的聖托里尼」, 在那呈現是 童話七彩繽紛的藝術氛圍濃郁景象。 此處會令人一想到要去釜山旅遊, 便會直接聯想到甘川洞的七彩童話魅力。 便是連韓國人都會選擇的國內一日遊閒逛、 玩拍景點。 我們四月份前往, 亦正是釜山櫻花熱烈綻放的時候, 甘川洞內童話七彩山谷房外、山丘襯托上 粉櫻處處, 視覺雙層享受, 美不勝收。 我們選擇搭乘公共巴士前往甘川洞文化村站下車, 因為小巴會在甘川洞文化村的入口不遠處停下, 非常方便, 班次也算密集,不會讓你等太久。 大約10分鐘的車程,車資韓幣1,000 , 便宜省時的前往方法。 甘川洞文化村反而不太靠近地鐵站, 離開地鐵站還是要經小巴或計程的士前往的。 我們下車不遠處便會看見甘川洞文化村的牌子了, 你亦會見到很多遊客在你身旁熙來攘往。 再往前方斜坡道上望過去, 斜坡下方一大片 及上面山城皆呈現魅力七彩高低有緻的洞洞屋, 斜坡路上剛好見一穿著韓國民族服的女子身影, 時光倒流似的非常有感染力的畫面。 縱目山谷下一整片七彩童話洞洞房子山城, 似有看不完、數不盡的景點或是特色小吃、 飲品店藏身其中, 吸引你的目光上、下不停搜索。 追尋特色景點不要錯過每一處, 必須要用上一整天的時間方能盡情遊覽。 要追尋甘川洞文化村的特色之一, 與小王子和沙漠狐狸拍照的, 早上去一定是排長隊伍, 建議下午拍, 排隊只需數分鐘而已, 而太陽又不會那麼猛烈。 另外, 還要找找「穿越巷弄的魚」拍拍, 各種創意壁畫、蜿蜒村莊小巷都蘊含著的故事與文化特色, 各種可愛的塗鴉和裝置藝術等等滿目皆是, 令你的行程雀躍而忙碌, 走在石頭地板上的 純樸村莊裡卻處處是壁畫,每個轉角都是有驚喜。 甘川洞文化村建立在山谷裡,地勢頗為陡峭的, 有些小坡斜道需要爬樓梯走山坡。 其實甘川洞文化村早在1950年代, 是一處貧民村,因早期許多人因戰爭 逃到了甘川洞這一帶避難而共同聚居形成的, 至今仍保留着釜山近现代的历史痕迹。 在2009年韓國政府、藝術家和當地居民共同 把甘川洞改造成美麗的壁畫村,因此才會有現在 如此美麗童話似的甘川洞文化村, 漸漸地吸引了各地的遊客造訪。 當然直到現在還是有很多當地居民居於此處, 所以大家到訪時記得要輕聲細語保持安靜, 也不要打擾到當地居民的生活為要。 累了口喝了, 我們選了一間向著山谷景觀的 彩洞房子咖啡屋, 老板娘客氣且公道, 引領你先盡情搜視整個三層咖啡屋可觀取景欣賞處, 滿意了下單。 我們先後在咖啡屋的二樓、三樓一邊喝著 粉粉吸晴香甜士多啤梨沙冰, 一邊觀賞著山谷下 一灑遍地的七彩繽紛、童話夢幻般彩房浻屋, 一直延伸至遠處的海邊前方才止步。 甘川洞文化村是蠻值得一訪的地方, 也是欣賞釜山山城景色的好去處。 地址: 韓國釜山廣域市沙下區甘川洞的一處城鎮 #名古屋白川鄉合掌村# #意大義布拉諾島 Burano# 其它文章, 詳情請點擊澳門科學館「蒸氣誌(電子月刊)」 內之「近代中國科學家事蹟及其精神」 https://www.msc.org.mo/zh/flipbook/55/S-TEAM-ISSUE 本篇文章、相片以及影片版權屬作者所有, 經由版權持有人授權CyberCTM.com發表。 聯絡及邀約: irene801802@hotmail.com

WilltheChina-USTariffTradeWarEndin2026?
宗教玄學
熊神進・2025-11-15

Trump announced that a 100% tariff will be imposed on Chinese goods exported to the United States starting from November 1st, and export controls will be implemented on "all critical software". Trump's new trade action is a response to China's significant expansion of export controls on rare earth elements.According to a Reuters report on October 17th, when US President Donald Trump was interviewed by FBN and asked whether such high tariffs are sustainable and what impact they might have on the economy, he responded, "This is unsustainable."The United States will impose an additional 100% tariff on Chinese products. Spokespersons of the chambers of commerce in Hong Kong and Macau believe that the goods for the US Thanksgiving have already been delivered. Moreover, most mainland Chinese, Hong Kong, and Macau merchants have relocated their factories in the United States to Southeast Asia, India, and other regions. Therefore, it is believed that the impact of this measure will not be significant. We attempt to use China's traditional "Bazi (Eight Characters) Theory" (八字理論)to predict whether the China-US tariff trade war will end in 2026.The United States was founded on July 4th, 1776, and the People's Republic of China was founded at 15:00 on October 1st, 1949.From the perspective of Bazi numerology, analyzing whether the China-US tariff trade war will end or ease in 2026 requires combining the five-element characteristics (五行特徵)of the Bazi of the two countries and the interaction of their annual fortunes.The Bazi of the United States is: Bing Shen(丙申), Jia Wu(甲午), Geng Yin(庚寅), Xin Si(辛巳). Geng Jin(庚金) is born in the Wu month(五月) (the fifth lunar month), where the fire element is strong, so Geng Jin (庚金)is restrained. However, the Shen Jin(申金) in the Year Pillar(年柱) and the Si Huo(巳火) in the Hour Pillar(時柱) contain the root of Geng Jin(庚金), and with the support of Xin Jin辛金, its own strength should not be underestimated. In its Bazi, the fire and wood elements are relatively strong, and the metal element also has a certain degree of strength, resulting in a slight imbalance of the five elements.The Bazi of China is: Ji Chou(己丑), Gui You(癸酉), Jia Zi(甲子), Xin Wei(辛未). Jia Mu (甲木)is born in the You month(酉月) (the eighth lunar month), where the metal element is strong and the wood element is weak. However, the Ji Chou(己丑) in the e Year Pillar(年柱) and the Xin Wei (辛未) in the Hour Pillar(時柱) contain earth, which generates metal. Additionally, the Gui You (癸酉) in the Month Pillar(月柱) forms a cycle where metal generates water and water generates wood, creating a certain circulation of the five elements. Although Jia Mu(甲木) is in a weak position, it has the support of Yin Xing (印星) and Bi Jie (比肩星), so its foundation is relatively stable.The year 2026 is the Bing Wu year(丙午年), which belongs to the fire element in the five elements. From the perspective of the US Bazi, Bing Huo (丙火)represents Qi Sha (七殺), and Wu (戊)represents Zheng Guan (正官). The simultaneous appearance of Qi Sha(七殺) and Zheng Guan(正官) symbolizes pressure, conflict, and change. In this year, the United States may face greater pressure and challenges in its foreign policies, and there may be volatility and adjustments in its trade policies. For China's Bazi, Bing Huo(丙火) represents Zheng Guan(正官) , and Wu Huo(午火) represents Shi Shen (食神). Shang Guan (正官)and Shi Shen (食神) symbolize innovation, change, and external communication. In this year, China may introduce new measures and ideas in its trade policies to respond to external pressure. From the perspective of the mutual generation and restriction of the five elements, the fire element of the Bing Wu year 2026 forms a stronger mutual generation relationship with the fire and wood elements in the US Bazi. The excessive fire energy may make the United States more aggressive in its trade policies, but at the same time, it may also trigger a series of problems due to excessive impulsiveness, forcing it to make adjustments. For China's Bazi, although fire represents Shang Guan and Shi Shen, it also has a certain mutual generation relationship with its own five elements. In this year, China may take more proactive measures to respond to the trade war and ease pressure through its own wisdom and strategies. Overall, the China-US tariff trade war may experience a relatively intense phase in 2026. However, precisely because both sides are facing different pressures and challenges, it may prompt them to re-examine their trade policies, thereby creating opportunities for a certain degree of easing. Nevertheless, Bazi numerology analysis is only a traditional cultural perspective and is for reference only. The actual trend of the trade war still needs to be comprehensively judged by combining more realistic factors such as politics and economy.